Class EcdsaPrivateKeyBuilder

java.lang.Object
zeroecho.core.alg.ecdsa.EcdsaPrivateKeyBuilder
All Implemented Interfaces:
AsymmetricKeyBuilder<EcdsaPrivateKeySpec>

public final class EcdsaPrivateKeyBuilder extends Object implements AsymmetricKeyBuilder<EcdsaPrivateKeySpec>

ECDSA Private Key Builder

Implementation of AsymmetricKeyBuilder for EcdsaPrivateKeySpec. This builder is responsible for importing ECDSA private keys from encoded representations.

Supported operations

Encoding

The EcdsaPrivateKeySpec stores the private key in PKCS#8 DER format. This builder delegates to a JCA KeyFactory for the "EC" algorithm to reconstruct a usable PrivateKey.

Usage

Typically accessed indirectly through CryptoAlgorithms.privateKey(String, zeroecho.core.spec.AlgorithmKeySpec) or CryptoAlgorithm.importPrivate(zeroecho.core.spec.AlgorithmKeySpec).

 // Example: Import an ECDSA private key
 byte[] pkcs8 = ...; // load PKCS#8 DER data
 EcdsaPrivateKeySpec spec = new EcdsaPrivateKeySpec(pkcs8);
 PrivateKey priv = new EcdsaPrivateKeyBuilder().importPrivate(spec);
 
Since:
1.0