Class Keys

java.lang.Object
dev.sigstore.encryption.Keys

public class Keys extends Object
For internal use. Key related utility functions.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static PublicKey
    parseEcdsa(byte[] contents)
    Takes a PKIX DER formatted ECDSA public key in bytes and constructs a PublicKey with it.
    static PublicKey
    parseEd25519(byte[] contents)
    Takes a PKIX DER formatted Ed25519 public key in bytes and constructs a PublicKey with it.
    static PublicKey
    parseRsa(byte[] contents)
    Takes a PKIX DER formatted RSA public key in bytes and constructs a PublicKey with it.
    static PublicKey
    parseRsaPkcs1(byte[] contents)
    Takes a PKCS1 DER formatted RSA public key in bytes and constructs a PublicKey with it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Keys

      public Keys()
  • Method Details

    • parseEcdsa

      public static PublicKey parseEcdsa(byte[] contents) throws InvalidKeySpecException
      Takes a PKIX DER formatted ECDSA public key in bytes and constructs a PublicKey with it.
      Parameters:
      contents - the public key bytes
      Returns:
      a PublicKey object
      Throws:
      InvalidKeySpecException - if the public key material is invalid
    • parseEd25519

      public static PublicKey parseEd25519(byte[] contents) throws InvalidKeySpecException
      Takes a PKIX DER formatted Ed25519 public key in bytes and constructs a PublicKey with it.
      Parameters:
      contents - the public key bytes
      Returns:
      a PublicKey object
      Throws:
      InvalidKeySpecException - if the public key material is invalid
    • parseRsa

      public static PublicKey parseRsa(byte[] contents) throws InvalidKeySpecException
      Takes a PKIX DER formatted RSA public key in bytes and constructs a PublicKey with it.
      Parameters:
      contents - the public key bytes
      Returns:
      a PublicKey object
      Throws:
      InvalidKeySpecException - if the public key material is invalid
    • parseRsaPkcs1

      public static PublicKey parseRsaPkcs1(byte[] contents) throws InvalidKeySpecException
      Takes a PKCS1 DER formatted RSA public key in bytes and constructs a PublicKey with it.
      Parameters:
      contents - the public key bytes
      Returns:
      a PublicKey object
      Throws:
      InvalidKeySpecException - if the public key material is invalid