org.keycloak.common.util

## Class CertificateUtils

- java.lang.Object
- - org.keycloak.common.util.CertificateUtils

-     public class CertificateUtils
      extends Object

  The Class CertificateUtils provides utility functions for generation of V1 and V3 `X509Certificate`
  Version:
    $Revision: 2 $
  Author:
    Bill Burke, Giriraj Sharma

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CertificateUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.bouncycastle.operator.ContentSigner` | `createSigner(PrivateKey privateKey)` Creates the content signer for generation of Version 1 `X509Certificate`.
    `static X509Certificate` | `generateV1SelfSignedCertificate(KeyPair caKeyPair, String subject)` Generate version 1 self signed `X509Certificate`..
    `static X509Certificate` | `generateV3Certificate(KeyPair keyPair, PrivateKey caPrivateKey, X509Certificate caCert, String subject)` Generates version 3 `X509Certificate`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CertificateUtils

          public CertificateUtils()

  - ### Method Detail

    - #### generateV3Certificate

          public static X509Certificate generateV3Certificate(KeyPair keyPair,
                                                              PrivateKey caPrivateKey,
                                                              X509Certificate caCert,
                                                              String subject)
                                                       throws Exception

      Generates version 3 `X509Certificate`.
      Parameters:
        `keyPair` - the key pair
        `caPrivateKey` - the CA private key
        `caCert` - the CA certificate
        `subject` - the subject name
      Returns:
        the x509 certificate
      Throws:
        `Exception` - the exception

    - #### generateV1SelfSignedCertificate

          public static X509Certificate generateV1SelfSignedCertificate(KeyPair caKeyPair,
                                                                        String subject)
                                                                 throws Exception

      Generate version 1 self signed `X509Certificate`..
      Parameters:
        `caKeyPair` - the CA key pair
        `subject` - the subject name
      Returns:
        the x509 certificate
      Throws:
        `Exception` - the exception

    - #### createSigner

          public static org.bouncycastle.operator.ContentSigner createSigner(PrivateKey privateKey)

      Creates the content signer for generation of Version 1 `X509Certificate`.
      Parameters:
        `privateKey` - the private key
      Returns:
        the content signer

Copyright © 2016 JBoss by Red Hat. All rights reserved.