Top Description Fields Methods
org.keycloak.common.crypto

public Interface CertificateUtilsProvider

Imports
java.io.IOException, java.math.BigInteger, java.security.GeneralSecurityException, .KeyPair, .PrivateKey, java.security.cert.X509Certificate, java.util.Date, .List

The Class CertificateUtils provides utility functions for generation of V1 and V3 java.security.cert.X509Certificate

Field Summary

Modifier and TypeField and Description
public static final String

Method Summary

Modifier and TypeMethod and Description
public X509Certificate
createServicesTestCertificate(String dn, Date startDate, Date expiryDate, KeyPair keyPair, String... certificatePolicyOid)

public X509Certificate

Returns:

the x509 certificate
generateV1SelfSignedCertificate
(KeyPair
the CA key pair
caKeyPair
,
String
the subject name
subject
)

Generate version 1 self signed java.security.cert.X509Certificate..

public X509Certificate
generateV1SelfSignedCertificate(KeyPair caKeyPair, String subject, BigInteger serialNumber)

public X509Certificate

Returns:

the x509 certificate
generateV3Certificate
(KeyPair
the key pair
keyPair
,
PrivateKey
the CA private key
caPrivateKey
,
X509Certificate
the CA certificate
caCert
,
String
the subject name
subject
)

Generates version 3 java.security.cert.X509Certificate.

public List<String>
public List<String>

Field Detail

CRL_DISTRIBUTION_POINTS_OIDback to summary
public static final String CRL_DISTRIBUTION_POINTS_OID

Method Detail

createServicesTestCertificateback to summary
public X509Certificate createServicesTestCertificate(String dn, Date startDate, Date expiryDate, KeyPair keyPair, String... certificatePolicyOid)
generateV1SelfSignedCertificateback to summary
public X509Certificate generateV1SelfSignedCertificate(KeyPair caKeyPair, String subject)

Generate version 1 self signed java.security.cert.X509Certificate..

Parameters
caKeyPair:KeyPair

the CA key pair

subject:String

the subject name

Returns:X509Certificate

the x509 certificate

Exceptions
Exception:
the exception
generateV1SelfSignedCertificateback to summary
public X509Certificate generateV1SelfSignedCertificate(KeyPair caKeyPair, String subject, BigInteger serialNumber)
generateV3Certificateback to summary
public X509Certificate generateV3Certificate(KeyPair keyPair, PrivateKey caPrivateKey, X509Certificate caCert, String subject) throws Exception

Generates version 3 java.security.cert.X509Certificate.

Parameters
keyPair:KeyPair

the key pair

caPrivateKey:PrivateKey

the CA private key

caCert:X509Certificate

the CA certificate

subject:String

the subject name

Returns:X509Certificate

the x509 certificate

Exceptions
Exception:
the exception
getCertificatePolicyListback to summary
public List<String> getCertificatePolicyList(X509Certificate cert) throws GeneralSecurityException
getCRLDistributionPointsback to summary
public List<String> getCRLDistributionPoints(X509Certificate cert) throws IOException