Class PK11Signature

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class PK11Signature
    extends SignatureSpi
    implements java.lang.AutoCloseable
    • Field Detail

      • digestAlgorithm

        protected Algorithm digestAlgorithm
      • key

        protected org.mozilla.jss.pkcs11.PK11Key key
      • state

        protected int state
      • sigContext

        protected org.mozilla.jss.pkcs11.SigContextProxy sigContext
      • raw

        protected boolean raw
      • rawInput

        protected java.io.ByteArrayOutputStream rawInput
    • Method Detail

      • engineInitSign

        public void engineInitSign​(PrivateKey privateKey,
                                   java.security.SecureRandom random)
                            throws java.security.InvalidKeyException,
                                   TokenException
        This is just here for JCA compliance, we don't take randoms this way.
        Specified by:
        engineInitSign in class SignatureSpi
        Throws:
        java.security.InvalidKeyException
        TokenException
      • initSigContext

        protected void initSigContext()
                               throws TokenException
        Creates a signing context, initializes it, and sets the sigContext field.
        Throws:
        TokenException
      • engineRawVerifyNative

        protected static boolean engineRawVerifyNative​(PK11Token token,
                                                       java.security.PublicKey key,
                                                       byte[] hash,
                                                       byte[] signature)
                                                throws java.security.SignatureException,
                                                       TokenException
        Performs raw verification of the signature of a hash using the given public key, on the given token.
        Throws:
        java.security.SignatureException
        TokenException
      • engineVerifyNative

        protected boolean engineVerifyNative​(byte[] sigBytes)
                                      throws java.security.SignatureException,
                                             TokenException
        Throws:
        java.security.SignatureException
        TokenException
      • engineSetParameter

        public void engineSetParameter​(java.security.spec.AlgorithmParameterSpec params)
                                throws java.security.InvalidAlgorithmParameterException,
                                       TokenException
        Specified by:
        engineSetParameter in class SignatureSpi
        Throws:
        java.security.InvalidAlgorithmParameterException
        TokenException
      • 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