Top Description Constructors Methods
org.keycloak.common.util

public Class CertificateUtils

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.KeyPair, .PrivateKey, java.security.cert.X509Certificate, org.keycloak.common.crypto.CryptoIntegration

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static 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 static X509Certificate
generateV1SelfSignedCertificate(KeyPair caKeyPair, String subject, BigInteger serialNumber)

public static 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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CertificateUtilsback to summary
public CertificateUtils()

Method Detail

generateV1SelfSignedCertificateback to summary
public static 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 static X509Certificate generateV1SelfSignedCertificate(KeyPair caKeyPair, String subject, BigInteger serialNumber)
generateV3Certificateback to summary
public static 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