|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.security.SignatureSpi
|
+--de.flexiprovider.api.Signature
|
+--de.flexiprovider.pqc.hbc.cmss.CMSSSignature
This class implements the CMSS2 signature scheme. The class extends the SignatureSpi class. It is able to use the SPR hash functions as described in E. Dahmen et al., "Digital Signatures Out of Second-Preimage Resistant Hash Functions".
The CMSS2Signature can be used as follows:
Signature generation:
1. generate KeySpec from encoded CMSS2 private key:
KeySpec privateKeySpec = new PKCS8EncodedKeySpec(encPrivateKey);
2. get instance of CMSS2 key factory:
KeyFactory keyFactory = KeyFactory.getInstance("CMSS2","FlexiPQC");
3. decode CMSS2 private key:
PrivateKey privateKey = keyFactory.generatePrivate(privateKeySpec);
4. get instance of a CMSS2 signature:
Signature cmmsSig =
Signature.getInstance("SHA1andWinternitzOTS_1","FlexiPQC");
5. initialize signing:
cmssSig.initSign(privateKey);
6. sign message:
cmssSig.update(message.getBytes());
signature = cmssSig.sign();
return signature;
Signature verification:
1. generate KeySpec from encoded CMSS2 public key:
KeySpec publicKeySpec = new X509EncodedKeySpec(encPublicKey);
2. decode CMSS2 public key:
PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);
3. initialize verifying:
cmssSig.initVerify(publicKey);
4. Verify the signature:
cmssSig.update(message.getBytes());
return cmssSig.verify(signature);
CMSS2KeyPairGenerator| Inner Class Summary | |
static class |
CMSSSignature.SHA1andBiBaOTS
CMSSSignature with SHA1 message digest, BiBa OTS and SHA1PRNG |
static class |
CMSSSignature.SHA1andBiBaOTS50
CMSSSignature with SHA1 message digest, BiBa OTS (security level 50) and SHA1PRNG |
static class |
CMSSSignature.SHA1andBiBaOTS50withSPR
CMSSSignature with SHA1 message digest, BiBa OTS (security level 50) and SHA1PRNG with SPR |
static class |
CMSSSignature.SHA1andBiBaOTS80
CMSSSignature with SHA1 message digest, BiBa OTS (security level 80) and SHA1PRNG |
static class |
CMSSSignature.SHA1andBiBaOTS80withSPR
CMSSSignature with SHA1 message digest, BiBa OTS (security level 80) and SHA1PRNG with SPR |
static class |
CMSSSignature.SHA1andBiBaOTSwithSPR
CMSSSignature with SHA1 message digest, BiBa OTS2 and SHA1PRNG with SPR |
static class |
CMSSSignature.SHA1andLMOTS
CMSS2Signature with SHA1 message digest, LM OTS, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzOTS_1
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=1, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzOTS_1withSPR
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=1, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA1andWinternitzOTS_2
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzOTS_2withSPR
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=2, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA1andWinternitzOTS_3
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzOTS_3withSPR
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=3, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA1andWinternitzOTS_4
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzOTS_4withSPR
CMSSSignature with SHA1 message digest, Winternitz OTS with parameter w=4, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA1andWinternitzPRFOTS_16
CMSSSignature with SHA1 message digest, Winternitz PRF OTS with parameter w=16, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzPRFOTS_2
CMSS2Signature with SHA1 message digest, Winternitz PRF OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzPRFOTS_20
CMSSSignature with SHA1 message digest, Winternitz PRF OTS with parameter w=20, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzPRFOTS_3
CMSSSignature with SHA1 message digest, Winternitz PRF OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzPRFOTS_4
CMSSSignature with SHA1 message digest, Winternitz PRF OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzPRFOTS_5
CMSSSignature with SHA1 message digest, Winternitz PRF OTS with parameter w=5, and SHA1PRNG |
static class |
CMSSSignature.SHA1andWinternitzPRFOTS_8
CMSSSignature with SHA1 message digest, Winternitz PRF OTS with parameter w=8, and SHA1PRNG |
static class |
CMSSSignature.SHA256andLMOTS
CMSS2Signature with SHA256 message digest, LM OTS, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzOTS_1
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=1, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzOTS_1withSPR
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=1, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA256andWinternitzOTS_2
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzOTS_2withSPR
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=2, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA256andWinternitzOTS_3
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzOTS_3withSPR
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=3, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA256andWinternitzOTS_4
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzOTS_4withSPR
CMSSSignature with SHA256 message digest, Winternitz OTS with parameter w=4, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA256andWinternitzPRFOTS_16
CMSSSignature with SHA256 message digest, Winternitz PRF OTS with parameter w=16, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzPRFOTS_2
CMSSSignature with SHA256 message digest, Winternitz PRF OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzPRFOTS_3
CMSSSignature with SHA256 message digest, Winternitz PRF OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzPRFOTS_4
CMSSSignature with SHA256 message digest, Winternitz PRF OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzPRFOTS_5
CMSSSignature with SHA256 message digest, Winternitz PRF OTS with parameter w=5, and SHA1PRNG |
static class |
CMSSSignature.SHA256andWinternitzPRFOTS_8
CMSSSignature with SHA256 message digest, Winternitz PRF OTS with parameter w=8, and SHA1PRNG |
static class |
CMSSSignature.SHA384andLMOTS
CMSS2Signature with SHA384 message digest, LM OTS, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzOTS_1
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=1, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzOTS_1withSPR
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=1, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA384andWinternitzOTS_2
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzOTS_2withSPR
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=2, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA384andWinternitzOTS_3
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzOTS_3withSPR
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=3, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA384andWinternitzOTS_4
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzOTS_4withSPR
CMSSSignature with SHA384 message digest, Winternitz OTS with parameter w=4, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA384andWinternitzPRFOTS_16
CMSSSignature with SHA384 message digest, Winternitz PRF OTS with parameter w=16, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzPRFOTS_2
CMSSSignature with SHA384 message digest, Winternitz PRF OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzPRFOTS_3
CMSSSignature with SHA384 message digest, Winternitz PRF OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzPRFOTS_4
CMSSSignature with SHA384 message digest, Winternitz PRF OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzPRFOTS_5
CMSSSignature with SHA384 message digest, Winternitz PRF OTS with parameter w=5, and SHA1PRNG |
static class |
CMSSSignature.SHA384andWinternitzPRFOTS_8
CMSSSignature with SHA384 message digest, Winternitz PRF OTS with parameter w=8, and SHA1PRNG |
static class |
CMSSSignature.SHA512andLMOTS
CMSS2Signature with SHA512 message digest, LM OTS, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzOTS_1
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=1, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzOTS_1withSPR
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=1, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA512andWinternitzOTS_2
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzOTS_2withSPR
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=2, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA512andWinternitzOTS_3
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzOTS_3withSPR
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=3, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA512andWinternitzOTS_4
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzOTS_4withSPR
CMSSSignature with SHA512 message digest, Winternitz OTS with parameter w=4, SHA1PRNG and SPR |
static class |
CMSSSignature.SHA512andWinternitzPRFOTS_16
CMSSSignature with SHA512 message digest, Winternitz PRF OTS with parameter w=16, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzPRFOTS_2
CMSSSignature with SHA512 message digest, Winternitz PRF OTS with parameter w=2, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzPRFOTS_3
CMSSSignature with SHA512 message digest, Winternitz PRF OTS with parameter w=3, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzPRFOTS_4
CMSSSignature with SHA512 message digest, Winternitz PRF OTS with parameter w=4, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzPRFOTS_5
CMSSSignature with SHA512 message digest, Winternitz PRF OTS with parameter w=5, and SHA1PRNG |
static class |
CMSSSignature.SHA512andWinternitzPRFOTS_8
CMSSSignature with SHA512 message digest, Winternitz PRF OTS with parameter w=8, and SHA1PRNG |
static class |
CMSSSignature.SWIFFTX224andLMOTS
CMSS2Signature with SWIFFTX224 message digest, LM OTS, and SWIFFTX224PRNG |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_1
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=1, and SWIFFTX224PRNG |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_1withSPR
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=1, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_2
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=2, and SWIFFTX224PRNG |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_2withSPR
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=2, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_3
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=3, and SWIFFTX224PRNG |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_3withSPR
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=3, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_4
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=4, and SWIFFTX224PRNG |
static class |
CMSSSignature.SWIFFTX224andWinternitzOTS_4withSPR
CMSSSignature with SWIFFTX224 message digest, Winternitz OTS with parameter w=4, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX256andLMOTS
CMSS2Signature with SWIFFTX256 message digest, LM OTS, and SWIFFTX256PRNG |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_1
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=1, and SWIFFTX256PRNG |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_1withSPR
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=1, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_2
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=2, and SWIFFTX256PRNG |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_2withSPR
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=2, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_3
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=3, and SWIFFTX256PRNG |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_3withSPR
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=3, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_4
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=4, and SWIFFTX256PRNG |
static class |
CMSSSignature.SWIFFTX256andWinternitzOTS_4withSPR
CMSSSignature with SWIFFTX256 message digest, Winternitz OTS with parameter w=4, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX384andLMOTS
CMSS2Signature with SWIFFTX384 message digest, LM OTS, and SWIFFTX384PRNG |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_1
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=1, and SWIFFTX384PRNG |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_1withSPR
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=1, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_2
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=2, and SWIFFTX384PRNG |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_2withSPR
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=2, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_3
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=3, and SWIFFTX384PRNG |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_3withSPR
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=3, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_4
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=4, and SWIFFTX384PRNG |
static class |
CMSSSignature.SWIFFTX384andWinternitzOTS_4withSPR
CMSSSignature with SWIFFTX384 message digest, Winternitz OTS with parameter w=4, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX512andLMOTS
CMSS2Signature with SWIFFTX512 message digest, LM OTS, and SWIFFTX512PRNG |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_1
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=1, and SWIFFTX512PRNG |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_1withSPR
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=1, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_2
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=2, and SWIFFTX512PRNG |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_2withSPR
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=2, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_3
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=3, and SWIFFTX512PRNG |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_3withSPR
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=3, SWIFFTX224PRNG and SPR |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_4
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=4, and SWIFFTX512PRNG |
static class |
CMSSSignature.SWIFFTX512andWinternitzOTS_4withSPR
CMSSSignature with SWIFFTX512 message digest, Winternitz OTS with parameter w=4, SWIFFTX224PRNG and SPR |
| Fields inherited from class java.security.SignatureSpi |
appRandom |
| Constructor Summary | |
protected |
CMSSSignature(java.lang.String oidString,
MessageDigest md,
OTS ots,
boolean useSpr)
Constructor. |
| Method Summary | |
void |
initSign(PrivateKey key,
SecureRandom random)
Initialize the signature algorithm for signing a message. |
void |
initVerify(PublicKey key)
Initialize the signature algorithm for verifying a signature. |
void |
setParameters(AlgorithmParameterSpec params)
Initialize this signature engine with the specified parameter set (not used). |
byte[] |
sign()
Sign a message. |
void |
update(byte data)
Feed a message byte to the message digest. |
void |
update(byte[] data,
int offset,
int length)
Feed message bytes to the message digest. |
boolean |
verify(byte[] sigBytes)
Verify a signature. |
| Methods inherited from class de.flexiprovider.api.Signature |
engineGetParameter, engineInitSign, engineInitSign, engineInitVerify, engineSetParameter, engineSetParameter, engineSign, engineUpdate, engineUpdate, engineVerify, engineVerify, initSign, sign, update, verify, verify, verify |
| Methods inherited from class java.security.SignatureSpi |
clone, engineSign |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
protected CMSSSignature(java.lang.String oidString,
MessageDigest md,
OTS ots,
boolean useSpr)
oidString - the OID string identifying the algorithmmd - the message digest used to build the authentication trees and
for the OTSots - the underlying OTSuseSpr - use SPR-CMSS (true) or not (false)| Method Detail |
public void initSign(PrivateKey key,
SecureRandom random)
throws InvalidKeyException
initSign in class Signaturekey - the private key of the signerrandom - a source of randomness (not used)InvalidKeyException - if the key is not an instance of OTSPrivateKey.
public void initVerify(PublicKey key)
throws InvalidKeyException
initVerify in class Signaturekey - the public key of the signer.InvalidKeyException - if the public key is not an instance of CMSS2PublicKey.public void setParameters(AlgorithmParameterSpec params)
setParameters in class Signatureparams - the parameters (not used)public void update(byte data)
update in class Signaturedata - array of message bytes
public void update(byte[] data,
int offset,
int length)
update in class Signaturedata - array of message bytesoffset - index of message startlength - number of message bytes
public byte[] sign()
throws SignatureException
sign in class SignatureSignatureException - if no more signatures can be generated with the private key.public boolean verify(byte[] sigBytes)
verify in class SignaturesigBytes - the signature to be verified.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||