de.flexiprovider.pqc.hbc.gmss
Class GMSSPrivateKey
java.lang.Object
|
+--de.flexiprovider.api.keys.PrivateKey
|
+--de.flexiprovider.pqc.hbc.gmss.GMSSPrivateKey
- All Implemented Interfaces:
- java.security.Key, Key, java.security.PrivateKey, java.io.Serializable
- public class GMSSPrivateKey
- extends PrivateKey
This class implements a GMSS private key and is usually initiated by the GMSSKeyPairGenerator.
- Author:
- Michael Schneider, Sebastian Blume
- See Also:
GMSSKeyPairGenerator,
GMSSPrivateKeySpec,
GMSSPrivateKeyASN1, Serialized Form
| Fields inherited from interface java.security.Key |
serialVersionUID |
| Fields inherited from interface java.security.PrivateKey |
serialVersionUID |
|
Constructor Summary |
protected |
GMSSPrivateKey(byte[][] currentSeed,
byte[][] nextNextSeed,
byte[][][] currentAuthPath,
byte[][][] nextAuthPath,
Treehash[][] currentTreehash,
Treehash[][] nextTreehash,
java.util.Vector[] currentStack,
java.util.Vector[] nextStack,
java.util.Vector[][] currentRetain,
java.util.Vector[][] nextRetain,
byte[][] nextRoot,
byte[][] currentRootSig,
GMSSParameterset gmssParameterset,
java.lang.String[] algNames)
Generates a new GMSS private key |
protected |
GMSSPrivateKey(GMSSPrivateKeySpec gmssPrivKeySpec)
Constructor |
protected |
GMSSPrivateKey(int[] index,
byte[][] currentSeeds,
byte[][] nextNextSeeds,
byte[][][] currentAuthPaths,
byte[][][] nextAuthPaths,
byte[][][] keep,
Treehash[][] currentTreehash,
Treehash[][] nextTreehash,
java.util.Vector[] currentStack,
java.util.Vector[] nextStack,
java.util.Vector[][] currentRetain,
java.util.Vector[][] nextRetain,
GMSSLeaf[] nextNextLeaf,
GMSSLeaf[] upperLeaf,
GMSSLeaf[] upperTreehashLeaf,
int[] minTreehash,
byte[][] nextRoot,
GMSSRootCalc[] nextNextRoot,
byte[][] currentRootSig,
GMSSRootSig[] nextRootSig,
GMSSParameterset gmssParameterset,
java.lang.String[] algNames)
Generates a new GMSS private key |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
GMSSPrivateKey
protected GMSSPrivateKey(byte[][] currentSeed,
byte[][] nextNextSeed,
byte[][][] currentAuthPath,
byte[][][] nextAuthPath,
Treehash[][] currentTreehash,
Treehash[][] nextTreehash,
java.util.Vector[] currentStack,
java.util.Vector[] nextStack,
java.util.Vector[][] currentRetain,
java.util.Vector[][] nextRetain,
byte[][] nextRoot,
byte[][] currentRootSig,
GMSSParameterset gmssParameterset,
java.lang.String[] algNames)
- Generates a new GMSS private key
- Parameters:
currentSeed - seed for the generation of private OTS keys for the
current subtreesnextNextSeed - seed for the generation of private OTS keys for the next
subtreescurrentAuthPath - array of current authentication pathsnextAuthPath - array of next authentication pathscurrentTreehash - array of current treehash instancesnextTreehash - array of next treehash instancescurrentStack - array of current shared stacksnextStack - array of next shared stackscurrentRetain - array of current retain stacksnextRetain - array of next retain stacksnextRoot - the roots of the next subtreecurrentRootSig - array of signatures of the roots of the current subtreesgmssParameterset - the GMSS ParametersetalgNames - An array of strings, containing the name of the used hash
function and the name of the corresponding provider- See Also:
GMSSKeyPairGenerator
GMSSPrivateKey
protected GMSSPrivateKey(GMSSPrivateKeySpec gmssPrivKeySpec)
- Constructor
- Parameters:
gmssPrivKeySpec - a valid GMSS privateKeySpec
GMSSPrivateKey
protected GMSSPrivateKey(int[] index,
byte[][] currentSeeds,
byte[][] nextNextSeeds,
byte[][][] currentAuthPaths,
byte[][][] nextAuthPaths,
byte[][][] keep,
Treehash[][] currentTreehash,
Treehash[][] nextTreehash,
java.util.Vector[] currentStack,
java.util.Vector[] nextStack,
java.util.Vector[][] currentRetain,
java.util.Vector[][] nextRetain,
GMSSLeaf[] nextNextLeaf,
GMSSLeaf[] upperLeaf,
GMSSLeaf[] upperTreehashLeaf,
int[] minTreehash,
byte[][] nextRoot,
GMSSRootCalc[] nextNextRoot,
byte[][] currentRootSig,
GMSSRootSig[] nextRootSig,
GMSSParameterset gmssParameterset,
java.lang.String[] algNames)
- Generates a new GMSS private key
- Parameters:
index - tree indicescurrentSeeds - seed for the generation of private OTS keys for the
current subtrees (TREE)nextNextSeeds - seed for the generation of private OTS keys for the
subtrees after next (TREE++)currentAuthPaths - array of current authentication paths (AUTHPATH)nextAuthPaths - array of next authentication paths (AUTHPATH+)keep - keep array for the authPath algorithmcurrentTreehash - treehash for authPath algorithm of current treenextTreehash - treehash for authPath algorithm of next tree (TREE+)currentStack - shared stack for authPath algorithm of current treenextStack - shared stack for authPath algorithm of next tree (TREE+)currentRetain - retain stack for authPath algorithm of current treenextRetain - retain stack for authPath algorithm of next tree (TREE+)nextNextLeaf - array of upcoming leafs of the tree after next (LEAF++) of
each layerupperLeaf - needed for precomputation of upper nodesupperTreehashLeaf - needed for precomputation of upper treehash nodesnextRoot - the roots of the next trees (ROOT+)nextNextRoot - the roots of the tree after next (ROOT++)currentRootSig - array of signatures of the roots of the current subtrees
(SIG)nextRootSig - array of signatures of the roots of the next subtree
(SIG+)gmssParameterset - the GMSS ParametersetalgNames - An array of strings, containing the name of the used hash
function and the name of the corresponding provider
nextKey
public void nextKey(int layer)
- This method updates the GMSS private key for the next signature
- Parameters:
layer - the layer where the next key is processed
getAlgorithm
public java.lang.String getAlgorithm()
- Returns:
- The name of the algorithm
getName
public java.lang.String[] getName()
- Returns:
- The detailed name of the algorithm
getOID
protected codec.asn1.ASN1ObjectIdentifier getOID()
- Overrides:
getOID in class PrivateKey
- Returns:
- the OID to encode in the SubjectPublicKeyInfo structure
getAlgParams
protected codec.asn1.ASN1Type getAlgParams()
- Overrides:
getAlgParams in class PrivateKey
- Returns:
- the algorithm parameters to encode in the SubjectPublicKeyInfo
structure
getKeyData
protected byte[] getKeyData()
- Overrides:
getKeyData in class PrivateKey
- Returns:
- the keyData to encode in the SubjectPublicKeyInfo structure
getIndex
protected int[] getIndex()
- Returns:
- The current indices array
getIndex
protected int getIndex(int i)
- Returns:
- The current index of layer i
getCurrentSeeds
protected byte[][] getCurrentSeeds()
- Returns:
- The array of current seeds
getNextNextSeeds
protected byte[][] getNextNextSeeds()
- Returns:
- The array of seeds after next (SEED++)
getCurrentAuthPaths
protected byte[][][] getCurrentAuthPaths()
- Returns:
- The current authentication path array
getNextAuthPaths
protected byte[][][] getNextAuthPaths()
- Returns:
- The next authentication path array
getCurrentTreehash
protected Treehash[][] getCurrentTreehash()
- Returns:
- The current treehash instances
getNextTreehash
protected Treehash[][] getNextTreehash()
- Returns:
- The next treehash instances
getCurrentStack
protected java.util.Vector[] getCurrentStack()
- Returns:
- The current treehash instances
getNextStack
protected java.util.Vector[] getNextStack()
- Returns:
- The next treehash instances
getCurrentRetain
protected java.util.Vector[][] getCurrentRetain()
- Returns:
- The current treehash instances
getNextRetain
protected java.util.Vector[][] getNextRetain()
- Returns:
- The next treehash instances
getNumLeafs
protected int getNumLeafs(int i)
- Returns:
- The number of leafs of each tree of layer i
getNumLeafs
protected int[] getNumLeafs()
- Returns:
- The array of number of leafs of a tree of each layer
getKeep
protected byte[][][] getKeep()
- Returns:
- The stack array
keep
getNextNextLeaf
protected GMSSLeaf[] getNextNextLeaf()
- Returns:
- An array of the GMSSLeafs of the tree after next of each layer
(LEAF++)
getUpperLeaf
protected GMSSLeaf[] getUpperLeaf()
- Returns:
- An array of the GMSSLeafs of the tree after next of each layer
(LEAF++)
getUpperTreehashLeaf
protected GMSSLeaf[] getUpperTreehashLeaf()
- Returns:
- An array of the GMSSLeafs of the tree after next of each layer
(LEAF++)
getMinTreehash
protected int[] getMinTreehash()
- Returns:
- An array of the indices of the next treehashs to receive updates
getNextRoot
protected byte[][] getNextRoot()
- Returns:
- An array of roots of the next subtree of each layer (ROOT+)
getNextNextRoot
protected GMSSRootCalc[] getNextNextRoot()
- Returns:
- An array of roots of the subtree after next of each layer
(ROOT++)
getCurrentRootSig
protected byte[][] getCurrentRootSig()
- Returns:
- An array of signatures of the current subtree roots of each layer
getParameterset
protected GMSSParameterset getParameterset()
- Returns:
- the GMSSParameterset
getSubtreeRootSig
protected byte[] getSubtreeRootSig(int i)
- Returns:
- The one-time signature of the root of the current subtree
getNextRootSig
protected GMSSRootSig[] getNextRootSig()
- Returns:
- The one-time signatures of the next root (SIG+)
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
- Returns:
- A human readable representation of main part of the key