return toX509(certificate);
}
public static X509Certificate selfSign(X500Principal subject, KeyPair keyPair) throws OpsException {
X500Principal issuer = subject;
Certificate certificate = signCertificate(BouncyCastleHelpers.toX500Name(issuer), keyPair.getPrivate(),
BouncyCastleHelpers.toX500Name(subject),
BouncyCastleHelpers.toSubjectPublicKeyInfo(keyPair.getPublic()));
return toX509(certificate);
}