Class Keys


  • public class Keys
    extends java.lang.Object
    For 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.PublicKey parseEcdsa​(byte[] contents)
      Takes a PKIX DER formatted ECDSA public key in bytes and constructs a PublicKey with it.
      static java.security.PublicKey parseEd25519​(byte[] contents)
      Takes a PKIX DER formatted Ed25519 public key in bytes and constructs a PublicKey with it.
      static java.security.PublicKey parseRsa​(byte[] contents)
      Takes a PKIX DER formatted RSA public key in bytes and constructs a PublicKey with it.
      static java.security.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 Detail

      • Keys

        public Keys()
    • Method Detail

      • parseEcdsa

        public static java.security.PublicKey parseEcdsa​(byte[] contents)
                                                  throws java.security.spec.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:
        java.security.spec.InvalidKeySpecException - if the public key material is invalid
      • parseEd25519

        public static java.security.PublicKey parseEd25519​(byte[] contents)
                                                    throws java.security.spec.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:
        java.security.spec.InvalidKeySpecException - if the public key material is invalid
      • parseRsa

        public static java.security.PublicKey parseRsa​(byte[] contents)
                                                throws java.security.spec.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:
        java.security.spec.InvalidKeySpecException - if the public key material is invalid
      • parseRsaPkcs1

        public static java.security.PublicKey parseRsaPkcs1​(byte[] contents)
                                                     throws java.security.spec.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:
        java.security.spec.InvalidKeySpecException - if the public key material is invalid