Class Ed25519PublicKeyBuilder
java.lang.Object
zeroecho.core.alg.common.eddsa.AbstractEncodedPublicKeyBuilder<Ed25519PublicKeySpec>
zeroecho.core.alg.ed25519.Ed25519PublicKeyBuilder
- All Implemented Interfaces:
PublicKeyImporter<Ed25519PublicKeySpec>
public final class Ed25519PublicKeyBuilder
extends AbstractEncodedPublicKeyBuilder<Ed25519PublicKeySpec>
Public key builder for Ed25519
ConcretePublicKeyImporter for importing wrapping
Ed25519 public keys.
This builder integrates with the JCA under the canonical key factory
algorithm name "Ed25519". It consumes an
Ed25519PublicKeySpec, which provides the encoded X.509 representation
of the public key.
Responsibilities
- Expose the JCA key factory name
"Ed25519"for interoperability. - Provide the encoded X.509 bytes via
Ed25519PublicKeySpec.encoded()for key material import.
Usage example
// Import a public key from its encoded X.509 form
Ed25519PublicKeySpec spec = new Ed25519PublicKeySpec(x509Bytes);
PublicKey publicKey = session.keyBuilders().asymmetric().importPublic("Ed25519", spec);
Thread-safety
Instances of this builder are stateless and may be reused safely across threads.- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]Returns the X.509 encoded bytes from the given key spec.protected StringReturns the canonical JCA algorithm name for Ed25519 key factories.Methods inherited from class AbstractEncodedPublicKeyBuilder
importPublic
-
Constructor Details
-
Ed25519PublicKeyBuilder
public Ed25519PublicKeyBuilder()Creates a stateless Ed25519 public-key importer.
-
-
Method Details
-
jcaKeyFactoryAlg
Returns the canonical JCA algorithm name for Ed25519 key factories.This value is used by the parent
AbstractEncodedPublicKeyBuilderto obtain aKeyFactory.- Specified by:
jcaKeyFactoryAlgin classAbstractEncodedPublicKeyBuilder<Ed25519PublicKeySpec>- Returns:
- the string
"Ed25519"
-
encodedX509
Returns the X.509 encoded bytes from the given key spec.This encoding is passed to the JCA
KeyFactoryfor parsing into aPublicKeyinstance.- Specified by:
encodedX509in classAbstractEncodedPublicKeyBuilder<Ed25519PublicKeySpec>- Parameters:
spec- the public key specification holding the X.509 encoding- Returns:
- a defensive copy of the X.509-encoded key bytes
-