code: public static X509Certificate newX509CertificateV1(KeyPair keyPair, X500Name issuer,
  		BigInteger serial, Date notBefore, Date notAfter, X500Name subject,
  		String signatureAlgorithm) throws OperatorCreationException, CertificateException
  	{
  		X509v1CertificateBuilder certBuilder = new JcaX509v1CertificateBuilder(issuer, serial,
  			notBefore, notAfter, subject, keyPair.getPublic());
  		ContentSigner signer = new JcaContentSignerBuilder(signatureAlgorithm)
  			.setProvider(SecurityProvider.BC.name()).build(keyPair.getPrivate());
  		X509Certificate x509Certificate = new JcaX509CertificateConverter()
  			.setProvider(SecurityProvider.BC.name()).getCertificate(certBuilder.build(signer));
  		return x509Certificate;
  	}
docs: Factory method for creating a new {@link X509Certificate} object of the first version of
  X.509 from the given parameters.
  
  SecurityProvider is Bouncy Castle.
  
  @param keyPair
  the key pair
  @param issuer
  X500Name representing the issuer of this certificate.
  @param serial
  the serial number for the certificate.
  @param notBefore
  date before which the certificate is not valid.
  @param notAfter
  date after which the certificate is not valid.
  @param subject
  X500Name representing the subject of this certificate.
  
  @param signatureAlgorithm
  the signature algorithm i.e 'SHA1withRSA'
  @return the new {@link X509Certificate} object
  
  @throws OperatorCreationException
  is thrown if a security error occur on creation of {@link ContentSigner}
  @throws CertificateException
  if the conversion is unable to be made