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 PublicKeyparseEcdsa(byte[] contents) Takes a PKIX DER formatted ECDSA public key in bytes and constructs aPublicKeywith it.static PublicKeyparseEd25519(byte[] contents) Takes a PKIX DER formatted Ed25519 public key in bytes and constructs aPublicKeywith it.static PublicKeyparseRsa(byte[] contents) Takes a PKIX DER formatted RSA public key in bytes and constructs aPublicKeywith it.static PublicKeyparseRsaPkcs1(byte[] contents) Takes a PKCS1 DER formatted RSA public key in bytes and constructs aPublicKeywith it.
-
Constructor Details
-
Keys
public Keys()
-
-
Method Details
-
parseEcdsa
Takes a PKIX DER formatted ECDSA public key in bytes and constructs aPublicKeywith 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 aPublicKeywith 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 aPublicKeywith 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 aPublicKeywith it.- Parameters:
contents- the public key bytes- Returns:
- a PublicKey object
- Throws:
InvalidKeySpecException- if the public key material is invalid
-