Signature implementations that can be
configured with a named parameter set. See NamedKeyPairGenerator
for more details.
This class does not work with preHash signatures.
| Modifier and Type | Field and Description |
|---|---|
| private final ByteArrayOutputStream | |
| private final NamedKeyFactory | |
| private final String | |
| private Object | |
| private String | |
| private byte[] | |
| private byte[] | |
| private Object |
| Access | Constructor and Description |
|---|---|
| protected | NamedSignature(String
the family name fname, NamedKeyFactory the fac)KeyFactory used to translate foreign keys and
perform key validationCreates a new |
| Modifier and Type | Method and Description |
|---|---|
| protected Object | engineGetParameter(String param)
Implements abstract java.
Deprecated
Gets the value of the specified algorithm parameter. |
| protected AlgorithmParameters | engineGetParameters()
Overrides java. Returns the parameters used with this |
| protected void | engineInitSign(PrivateKey privateKey)
Implements abstract java. Initializes this |
| protected void | engineInitVerify(PublicKey publicKey)
Implements abstract java. Initializes this |
| protected void | engineSetParameter(String param, Object value)
Implements abstract java.
Deprecated
Sets the specified algorithm parameter to the specified value. |
| protected void | engineSetParameter(AlgorithmParameterSpec params)
Overrides java. Initializes this |
| protected byte[] | engineSign()
Implements abstract java. Returns the signature bytes of all the data updated so far. |
| protected void | engineUpdate(byte b)
Implements abstract java. Updates the data to be signed or verified using the specified byte. |
| protected void | engineUpdate(byte[] b, int off, int len)
Implements abstract java. Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset. |
| protected boolean | engineVerify(byte[] sig)
Implements abstract java. Verifies the passed-in signature. |
| protected Object | Returns: a parsed key,null if none.parameter name pname, byte[] private key in raw bytes sk)User-defined function to validate a private key. |
| protected Object | Returns: a parsed key,null if none.parameter name pname, byte[] public key in raw bytes pk)User-defined function to validate a public key. |
| protected abstract byte[] | Returns: the signatureparameter name pname, byte[] private key in raw bytes sk, Object parsed private key, sk2, byte[] null if none. See implCheckPrivateKey.the message msg, SecureRandom SecureRandom object, sr)null if not initializedUser-defined sign function. |
| protected abstract boolean | Returns: true if verifiedparameter name pname, byte[] public key in raw bytes pk, Object parsed public key, pk2, byte[] null if none. See implCheckPublicKey.the message msg, byte[] the signature sig)User-defined verify function. |
| bout | back to summary |
|---|---|
| private final ByteArrayOutputStream bout | |
| fac | back to summary |
|---|---|
| private final NamedKeyFactory fac | |
| fname | back to summary |
|---|---|
| private final String fname | |
| pk2 | back to summary |
|---|---|
| private Object pk2 | |
| pname | back to summary |
|---|---|
| private String pname | |
| pubKey | back to summary |
|---|---|
| private byte[] pubKey | |
| secKey | back to summary |
|---|---|
| private byte[] secKey | |
| sk2 | back to summary |
|---|---|
| private Object sk2 | |
| NamedSignature | back to summary |
|---|---|
| protected NamedSignature(String fname, NamedKeyFactory fac) Creates a new
| |
| engineGetParameter | back to summary |
|---|---|
| protected Object engineGetParameter(String param) throws InvalidParameterException Implements abstract java. Doc from java. Deprecated
Gets the value of the specified algorithm parameter. This method supplies a general-purpose mechanism through which it is possible to get the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.
| |
| engineGetParameters | back to summary |
|---|---|
| protected AlgorithmParameters engineGetParameters() Overrides java. Doc from java. Returns the parameters used with this The returned parameters may be the same that were used to initialize
this However, if the signature scheme does not support returning
the parameters as
| |
| engineInitSign | back to summary |
|---|---|
| protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException Implements abstract java. Doc from java. Initializes this
| |
| engineInitVerify | back to summary |
|---|---|
| protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException Implements abstract java. Doc from java. Initializes this
| |
| engineSetParameter | back to summary |
|---|---|
| protected void engineSetParameter(String param, Object value) throws InvalidParameterException Implements abstract java. Doc from java. Deprecated
Sets the specified algorithm parameter to the specified value. This method supplies a general-purpose mechanism through which it is possible to set the various parameters of this object. A parameter may be any settable parameter for the algorithm, such as a parameter size, or a source of random bits for signature generation (if appropriate), or an indication of whether to perform a specific but optional computation. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.
| |
| engineSetParameter | back to summary |
|---|---|
| protected void engineSetParameter(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException Overrides java. Doc from java. Initializes this
| |
| engineSign | back to summary |
|---|---|
| protected byte[] engineSign() throws SignatureException Implements abstract java. Doc from java. Returns the signature bytes of all the data updated so far. The format of the signature depends on the underlying signature scheme.
| |
| engineUpdate | back to summary |
|---|---|
| protected void engineUpdate(byte b) throws SignatureException Implements abstract java. Doc from java. Updates the data to be signed or verified using the specified byte.
| |
| engineUpdate | back to summary |
|---|---|
| protected void engineUpdate(byte[] b, int off, int len) throws SignatureException Implements abstract java. Doc from java. Updates the data to be signed or verified, using the specified array of bytes, starting at the specified offset.
| |
| engineVerify | back to summary |
|---|---|
| protected boolean engineVerify(byte[] sig) throws SignatureException Implements abstract java. Doc from java. Verifies the passed-in signature.
| |
| implCheckPrivateKey | back to summary |
|---|---|
| protected Object implCheckPrivateKey(String pname, byte[] sk) throws InvalidKeyException User-defined function to validate a private key. This method will be called in The default implementation returns
| |
| implCheckPublicKey | back to summary |
|---|---|
| protected Object implCheckPublicKey(String pname, byte[] pk) throws InvalidKeyException User-defined function to validate a public key. This method will be called in The default implementation returns
| |
| implSign | back to summary |
|---|---|
| protected abstract byte[] implSign(String pname, byte[] sk, Object sk2, byte[] msg, SecureRandom sr) throws SignatureException User-defined sign function.
| |
| implVerify | back to summary |
|---|---|
| protected abstract boolean implVerify(String pname, byte[] pk, Object pk2, byte[] msg, byte[] sig) throws SignatureException User-defined verify function.
| |