public class RainbowKeyFactorySpi extends java.security.KeyFactorySpi implements AsymmetricKeyInfoConverter
| Constructor and Description |
|---|
RainbowKeyFactorySpi() |
| Modifier and Type | Method and Description |
|---|---|
java.security.PrivateKey |
engineGeneratePrivate(java.security.spec.KeySpec keySpec)
Converts, if possible, a key specification into a
BCRainbowPrivateKey. |
java.security.PublicKey |
engineGeneratePublic(java.security.spec.KeySpec keySpec)
Converts, if possible, a key specification into a
BCRainbowPublicKey. |
java.security.spec.KeySpec |
engineGetKeySpec(java.security.Key key,
java.lang.Class keySpec)
Converts a given key into a key specification, if possible.
|
java.security.Key |
engineTranslateKey(java.security.Key key)
Translates a key into a form known by the FlexiProvider.
|
java.security.PrivateKey |
generatePrivate(PrivateKeyInfo keyInfo) |
java.security.PublicKey |
generatePublic(SubjectPublicKeyInfo keyInfo) |
public java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
throws java.security.spec.InvalidKeySpecException
BCRainbowPrivateKey. Currently, the following key specifications
are supported: RainbowPrivateKeySpec, PKCS8EncodedKeySpec.
The ASN.1 definition of the key structure is
RainbowPrivateKey ::= SEQUENCE {
oid OBJECT IDENTIFIER -- OID identifying the algorithm
A1inv SEQUENCE OF OCTET STRING -- inversed matrix of L1
b1 OCTET STRING -- translation vector of L1
A2inv SEQUENCE OF OCTET STRING -- inversed matrix of L2
b2 OCTET STRING -- translation vector of L2
vi OCTET STRING -- num of elmts in each Set S
layers SEQUENCE OF Layer -- layers of F
}
Layer ::= SEQUENCE OF Poly
Poly ::= SEQUENCE {
alpha SEQUENCE OF OCTET STRING
beta SEQUENCE OF OCTET STRING
gamma OCTET STRING
eta OCTET
}
engineGeneratePrivate in class java.security.KeyFactorySpikeySpec - the key specificationjava.security.spec.InvalidKeySpecException - if the KeySpec is not supported.public java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
throws java.security.spec.InvalidKeySpecException
BCRainbowPublicKey. Currently, the following key specifications are
supported:X509EncodedKeySpec.
The ASN.1 definition of a public key's structure is
RainbowPublicKey ::= SEQUENCE {
oid OBJECT IDENTIFIER -- OID identifying the algorithm
docLength Integer -- length of signable msg
coeffquadratic SEQUENCE OF OCTET STRING -- quadratic (mixed) coefficients
coeffsingular SEQUENCE OF OCTET STRING -- singular coefficients
coeffscalar OCTET STRING -- scalar coefficients
}
engineGeneratePublic in class java.security.KeyFactorySpikeySpec - the key specificationjava.security.spec.InvalidKeySpecException - if the KeySpec is not supported.public final java.security.spec.KeySpec engineGetKeySpec(java.security.Key key,
java.lang.Class keySpec)
throws java.security.spec.InvalidKeySpecException
engineGetKeySpec in class java.security.KeyFactorySpikey - the keykeySpec - the key specificationjava.security.spec.InvalidKeySpecException - if the key type or key specification is not supported.public final java.security.Key engineTranslateKey(java.security.Key key)
throws java.security.InvalidKeyException
engineTranslateKey in class java.security.KeyFactorySpikey - the keyjava.security.InvalidKeyException - if the key is not supported.public java.security.PrivateKey generatePrivate(PrivateKeyInfo keyInfo) throws java.io.IOException
generatePrivate in interface AsymmetricKeyInfoConverterjava.io.IOExceptionpublic java.security.PublicKey generatePublic(SubjectPublicKeyInfo keyInfo) throws java.io.IOException
generatePublic in interface AsymmetricKeyInfoConverterjava.io.IOException