Class KeyFactorySpi
- java.lang.Object
-
- java.security.KeyFactorySpi
-
- org.bouncycastle.jcajce.provider.asymmetric.sm9.KeyFactorySpi
-
public class KeyFactorySpi extends java.security.KeyFactorySpiKeyFactory for the SM9 master keys (sm9signandsm9encrypt): the master public and private keys round-trip through their JCA X.509 / PKCS#8 encodings (the GM/T 0080-2020 key material under the GM algorithm OID; the bare GM/T 0080-2020 form is the lightweight key-parameter class'sgetEncoded()).A user's identity-based key is not decodable in isolation - it additionally needs the master public key and the identity, and for an encryption key the hid and the usage (KEM / decryption or key exchange) too - so it does not decode from a plain PKCS#8 spec. Rebuild a stored user key from its encoding plus that context with an
SM9SigUserPrivateKeySpec/SM9EncUserPrivateKeySpec(also handed back bygetKeySpec), or derive it afresh from the master private key via the master key'sgenerateUserKeyPairmethod.
-
-
Constructor Summary
Constructors Constructor Description KeyFactorySpi()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.security.PrivateKeyengineGeneratePrivate(java.security.spec.KeySpec keySpec)protected java.security.PublicKeyengineGeneratePublic(java.security.spec.KeySpec keySpec)protected java.security.spec.KeySpecengineGetKeySpec(java.security.Key key, java.lang.Class keySpec)protected java.security.KeyengineTranslateKey(java.security.Key key)
-
-
-
Method Detail
-
engineGeneratePublic
protected java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException- Specified by:
engineGeneratePublicin classjava.security.KeyFactorySpi- Throws:
java.security.spec.InvalidKeySpecException
-
engineGeneratePrivate
protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException- Specified by:
engineGeneratePrivatein classjava.security.KeyFactorySpi- Throws:
java.security.spec.InvalidKeySpecException
-
engineGetKeySpec
protected java.security.spec.KeySpec engineGetKeySpec(java.security.Key key, java.lang.Class keySpec) throws java.security.spec.InvalidKeySpecException- Specified by:
engineGetKeySpecin classjava.security.KeyFactorySpi- Throws:
java.security.spec.InvalidKeySpecException
-
engineTranslateKey
protected java.security.Key engineTranslateKey(java.security.Key key) throws java.security.InvalidKeyException- Specified by:
engineTranslateKeyin classjava.security.KeyFactorySpi- Throws:
java.security.InvalidKeyException
-
-