Package dev.sigstore.encryption
Class Keys
java.lang.Object
dev.sigstore.encryption.Keys
For internal use. Key related utility functions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PublicKey
parseEcdsa
(byte[] contents) Takes a PKIX DER formatted ECDSA public key in bytes and constructs aPublicKey
with it.static PublicKey
parseEd25519
(byte[] contents) Takes a PKIX DER formatted Ed25519 public key in bytes and constructs aPublicKey
with it.static PublicKey
parseRsa
(byte[] contents) Takes a PKIX DER formatted RSA public key in bytes and constructs aPublicKey
with it.static PublicKey
parseRsaPkcs1
(byte[] contents) Takes a PKCS1 DER formatted RSA public key in bytes and constructs aPublicKey
with it.
-
Constructor Details
-
Keys
public Keys()
-
-
Method Details
-
parseEcdsa
Takes a PKIX DER formatted ECDSA public key in bytes and constructs aPublicKey
with it.- Parameters:
contents
- the public key bytes- Returns:
- a PublicKey object
- Throws:
InvalidKeySpecException
- if the public key material is invalid
-
parseEd25519
Takes a PKIX DER formatted Ed25519 public key in bytes and constructs aPublicKey
with it.- Parameters:
contents
- the public key bytes- Returns:
- a PublicKey object
- Throws:
InvalidKeySpecException
- if the public key material is invalid
-
parseRsa
Takes a PKIX DER formatted RSA public key in bytes and constructs aPublicKey
with it.- Parameters:
contents
- the public key bytes- Returns:
- a PublicKey object
- Throws:
InvalidKeySpecException
- if the public key material is invalid
-
parseRsaPkcs1
Takes a PKCS1 DER formatted RSA public key in bytes and constructs aPublicKey
with it.- Parameters:
contents
- the public key bytes- Returns:
- a PublicKey object
- Throws:
InvalidKeySpecException
- if the public key material is invalid
-