Package org.mozilla.jss.pkcs11
Class PK11Signature
java.lang.Object
org.mozilla.jss.crypto.SignatureSpi
org.mozilla.jss.pkcs11.PK11Signature
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Algorithmprotected Algorithmprotected org.mozilla.jss.pkcs11.PK11Keyprotected booleanprotected ByteArrayOutputStreamprotected org.mozilla.jss.pkcs11.SigContextProxystatic final intprotected intprotected PK11Tokenprotected TokenProxystatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidengineInitSign(PrivateKey privateKey) voidengineInitSign(PrivateKey privateKey, SecureRandom random) This is just here for JCA compliance, we don't take randoms this way.voidengineInitVerify(PublicKey publicKey) protected static booleanengineRawVerifyNative(PK11Token token, PublicKey key, byte[] hash, byte[] signature) Performs raw verification of the signature of a hash using the given public key, on the given token.voidbyte[]intengineSign(byte[] outbuf, int offset, int len) voidengineUpdate(byte b) voidengineUpdate(byte[] b, int off, int len) protected voidengineUpdateNative(byte[] b, int off, int len) booleanengineVerify(byte[] sigBytes) protected booleanengineVerifyNative(byte[] sigBytes) voidfinalize()protected voidCreates a signing context, initializes it, and sets the sigContext field.protected void
-
Field Details
-
token
-
tokenProxy
-
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
-
UNINITIALIZED
public static final int UNINITIALIZED- See Also:
-
SIGN
public static final int SIGN- See Also:
-
VERIFY
public static final int VERIFY- See Also:
-
-
Constructor Details
-
PK11Signature
public PK11Signature(PK11Token token, SignatureAlgorithm algorithm) throws NoSuchAlgorithmException, TokenException
-
-
Method Details
-
engineInitSign
- Specified by:
engineInitSignin classSignatureSpi- Throws:
InvalidKeyExceptionTokenException
-
engineInitSign
public void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException, TokenException This is just here for JCA compliance, we don't take randoms this way.- Specified by:
engineInitSignin classSignatureSpi- Throws:
InvalidKeyExceptionTokenException
-
initSigContext
Creates a signing context, initializes it, and sets the sigContext field.- Throws:
TokenException
-
engineInitVerify
- Specified by:
engineInitVerifyin classSignatureSpi- Throws:
InvalidKeyExceptionTokenException
-
initVfyContext
- Throws:
TokenException
-
engineUpdate
- Specified by:
engineUpdatein classSignatureSpi- Throws:
SignatureExceptionTokenException
-
engineUpdate
- Specified by:
engineUpdatein classSignatureSpi- Throws:
SignatureExceptionTokenException
-
engineUpdateNative
- Throws:
TokenException
-
engineSign
- Specified by:
engineSignin classSignatureSpi- Throws:
SignatureExceptionTokenException
-
engineSign
- Specified by:
engineSignin classSignatureSpi- Throws:
SignatureExceptionTokenException
-
engineVerify
- Specified by:
engineVerifyin classSignatureSpi- Throws:
SignatureExceptionTokenException
-
engineRawVerifyNative
protected static boolean engineRawVerifyNative(PK11Token token, PublicKey key, byte[] hash, byte[] signature) throws SignatureException, TokenException Performs raw verification of the signature of a hash using the given public key, on the given token.- Throws:
SignatureExceptionTokenException
-
engineVerifyNative
- Throws:
SignatureExceptionTokenException
-
engineSetParameter
public void engineSetParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException, TokenException - Specified by:
engineSetParameterin classSignatureSpi- Throws:
InvalidAlgorithmParameterExceptionTokenException
-
finalize
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-