Class ECKeyConverter
java.lang.Object
com.github.toolarium.security.pki.impl.AbstractKeyConverter
com.github.toolarium.security.pki.impl.ECKeyConverter
- All Implemented Interfaces:
IKeyConverter
Implements the EC
IKeyConverter.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringthe private EC key certificate endstatic final Stringthe private ECA key certificate startstatic final Stringthe public EC key endstatic final Stringthe public EC key startFields inherited from class com.github.toolarium.security.pki.impl.AbstractKeyConverter
NL -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for ECConverterECKeyConverter(String provider) Constructor for ECConverter -
Method Summary
Modifier and TypeMethodDescriptionformatPKCS8(String content) Formats a raw base64 encoded PKCS8 to a well formed private key, which is bounded at the beginning by-----BEGIN ...formatPublicKey(PublicKey publicKey) Formats a public key into a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN ...getPublicKey(byte[] content) Reads PKCS#8 formated public key from a buffer, which are each bounded at the beginning by-----BEGIN ...normalizePKCS8(String content) Normalise a raw base64 encoded PKCS8 to a well formed private key.Methods inherited from class com.github.toolarium.security.pki.impl.AbstractKeyConverter
formatPrivateKey, generateKeyPair, generateKeyPair, getPrivateKey, getPrivateKey, getPrivateKey, getProvider, getPublicKey, getPublicKey, getType
-
Field Details
-
PUBLIC_EC_KEY_START
the public EC key start- See Also:
-
PUBLIC_EC_KEY_END
the public EC key end- See Also:
-
PRIVATE_EC_KEY_START
the private ECA key certificate start- See Also:
-
PRIVATE_EC_KEY_END
the private EC key certificate end- See Also:
-
-
Constructor Details
-
ECKeyConverter
public ECKeyConverter()Constructor for ECConverter -
ECKeyConverter
Constructor for ECConverter- Parameters:
provider- the provider or null to use default provider
-
-
Method Details
-
getPublicKey
Description copied from interface:IKeyConverterReads PKCS#8 formated public key from a buffer, which are each bounded at the beginning by-----BEGIN ... PUBLIC KEY-----, and bounded at the end by-----END ... PUBLIC KEY-----.- Parameters:
content- the data- Returns:
- the public key
- Throws:
IOException- in case of errorGeneralSecurityException- in case of error- See Also:
-
formatPublicKey
Description copied from interface:IKeyConverterFormats a public key into a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN ... PUBLIC KEY-----, and bounded at the end by-----END ... PUBLIC KEY-----.- Parameters:
publicKey- the public key to format- Returns:
- the well formed certificate
- See Also:
-
formatPKCS8
Description copied from interface:IKeyConverterFormats a raw base64 encoded PKCS8 to a well formed private key, which is bounded at the beginning by-----BEGIN ... PRIVATE KEY-----, and bounded at the end by-----END ... PRIVATE KEY-----.- Parameters:
content- the raw data to format- Returns:
- the well formed certificate
- See Also:
-
normalizePKCS8
Description copied from interface:IKeyConverterNormalise a raw base64 encoded PKCS8 to a well formed private key.- Parameters:
content- the raw data to normalise- Returns:
- the normalised private key
- See Also:
-