Package dev.sigstore.encryption
Class Keys
- java.lang.Object
-
- dev.sigstore.encryption.Keys
-
public class Keys extends java.lang.ObjectFor internal use. Key related utility functions.
-
-
Constructor Summary
Constructors Constructor Description Keys()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.security.PublicKeyparseEcdsa(byte[] contents)Takes a PKIX DER formatted ECDSA public key in bytes and constructs aPublicKeywith it.static java.security.PublicKeyparseEd25519(byte[] contents)Takes a PKIX DER formatted Ed25519 public key in bytes and constructs aPublicKeywith it.static java.security.PublicKeyparseRsa(byte[] contents)Takes a PKIX DER formatted RSA public key in bytes and constructs aPublicKeywith it.static java.security.PublicKeyparseRsaPkcs1(byte[] contents)Takes a PKCS1 DER formatted RSA public key in bytes and constructs aPublicKeywith it.
-
-
-
Method Detail
-
parseEcdsa
public static java.security.PublicKey parseEcdsa(byte[] contents) throws java.security.spec.InvalidKeySpecExceptionTakes a PKIX DER formatted ECDSA public key in bytes and constructs aPublicKeywith it.- Parameters:
contents- the public key bytes- Returns:
- a PublicKey object
- Throws:
java.security.spec.InvalidKeySpecException- if the public key material is invalid
-
parseEd25519
public static java.security.PublicKey parseEd25519(byte[] contents) throws java.security.spec.InvalidKeySpecExceptionTakes a PKIX DER formatted Ed25519 public key in bytes and constructs aPublicKeywith it.- Parameters:
contents- the public key bytes- Returns:
- a PublicKey object
- Throws:
java.security.spec.InvalidKeySpecException- if the public key material is invalid
-
parseRsa
public static java.security.PublicKey parseRsa(byte[] contents) throws java.security.spec.InvalidKeySpecExceptionTakes a PKIX DER formatted RSA public key in bytes and constructs aPublicKeywith it.- Parameters:
contents- the public key bytes- Returns:
- a PublicKey object
- Throws:
java.security.spec.InvalidKeySpecException- if the public key material is invalid
-
parseRsaPkcs1
public static java.security.PublicKey parseRsaPkcs1(byte[] contents) throws java.security.spec.InvalidKeySpecExceptionTakes a PKCS1 DER formatted RSA public key in bytes and constructs aPublicKeywith it.- Parameters:
contents- the public key bytes- Returns:
- a PublicKey object
- Throws:
java.security.spec.InvalidKeySpecException- if the public key material is invalid
-
-