Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## be.fgov.ehealth.technicalconnector.ra.utils
Class CertificateUtils

    java.lang.Object
      be.fgov.ehealth.technicalconnector.ra.utils.CertificateUtils

    public class CertificateUtils

extends Object

Utility class containing facilitators for certificate generation.

Constructor Summary
`CertificateUtils()`

Method Summary
`static byte[]` | `createCSR(DistinguishedName distingueshedName, KeyPair keyPair)` Generates a PKCS10 certificate request based on the given `DistinguishedName` and the keypair.
`static X509Certificate` | `generateCert(KeyPair pair)` Generates a self signed certificte with a C=Dummy as subject.
`static X509Certificate` | `generateCert(PublicKey rqPubKey, BigInteger serialNr, Credential cred)` Generates a self signed certificate based on the given `Credential`
`static KeyPair` | `generateKeyPair()` Generates a RSA 2048 keypair.
`static BigInteger` | `obtainSerialNumber(PrivateKey key, byte[] challenge)` Extract the serialnumber from the challenge.
`static X509Certificate` | `toX509Certificate(byte[] cert)` Convert a byte array to a `X509Certificate`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CertificateUtils

    public CertificateUtils()

Method Detail

### generateKeyPair

    public static KeyPair generateKeyPair()

  Generates a RSA 2048 keypair.

### createCSR

    public static byte[] createCSR(DistinguishedName distingueshedName,
                                   KeyPair keyPair)

  Generates a PKCS10 certificate request based on the given `DistinguishedName` and the keypair.

  The `DistinguishedName` is used for subject generation.

### generateCert

    public static X509Certificate generateCert(PublicKey rqPubKey,
                                               BigInteger serialNr,
                                               Credential cred)
                                        throws TechnicalConnectorException

  Generates a self signed certificate based on the given `Credential`

  Throws:
    `TechnicalConnectorException`

### generateCert

    public static X509Certificate generateCert(KeyPair pair)

  Generates a self signed certificte with a C=Dummy as subject.

### obtainSerialNumber

    public static BigInteger obtainSerialNumber(PrivateKey key,
                                                byte[] challenge)
                                         throws TechnicalConnectorException

  Extract the serialnumber from the challenge.

  Throws:
    `TechnicalConnectorException`

### toX509Certificate

    public static X509Certificate toX509Certificate(byte[] cert)

  Convert a byte array to a `X509Certificate`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Connector Packaging PERSPODOLOGIST 3.14.2 API
Copyright © {inceptionYear}-2018 eHealth. All Rights Reserved.