Class PK11PubKey

    • Field Detail

      • keyProxy

        protected org.mozilla.jss.pkcs11.KeyProxy keyProxy
    • Constructor Detail

      • PK11PubKey

        protected PK11PubKey​(byte[] pointer)
    • Method Detail

      • getKeyType

        public KeyType getKeyType()
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Specified by:
        getAlgorithm in interface java.security.Key
      • fromRaw

        @Deprecated
        public static PK11PubKey fromRaw​(PrivateKey.Type type,
                                         byte[] rawKey)
                                  throws InvalidKeyFormatException
        Deprecated.
        This method works for RSA keys but not DSA or EC keys. Use fromSPKI() instead.
        Creates a PK11PubKey from its raw form. The raw form is a DER encoding of the public key. For example, this is what is stored in a SubjectPublicKeyInfo.
        Parameters:
        type - The type of private key to be decoded.
        rawKey - The bytes of the raw key.
        Throws:
        InvalidKeyFormatException - If the raw key could not be decoded.
        See Also:
        fromSPKI(byte[])
      • getEncoded

        public byte[] getEncoded()
        Returns a DER-encoded SubjectPublicKeyInfo representing this key.
        Specified by:
        getEncoded in interface java.security.Key
      • getFormat

        public java.lang.String getFormat()
        The name of the primary encoding format of this key. The primary encoding format is X.509 SubjectPublicKeyInfo, and the name is "X.509".
        Specified by:
        getFormat in interface java.security.Key
      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception