Top Inners Fields Constructors Methods
org.bouncycastle.jcajce.provider.keystore.bcfks

pack-priv Class BcFKSKeyStoreSpi

extends KeyStoreSpi
Class Inheritance
Known Direct Subclasses
org.bouncycastle.jcajce.provider.keystore.bcfks.BcFKSKeyStoreSpi.Std, org.bouncycastle.jcajce.provider.keystore.bcfks.BcFKSKeyStoreSpi.Def, org.bouncycastle.jcajce.provider.keystore.bcfks.BcFKSKeyStoreSpi.SharedKeyStoreSpi
Imports
java.io.ByteArrayInputStream, .IOException, .InputStream, .OutputStream, java.math.BigInteger, java.security.AlgorithmParameters, .GeneralSecurityException, .InvalidKeyException, .Key, .KeyFactory, .KeyStore, .KeyStoreException, .KeyStoreSpi, .NoSuchAlgorithmException, .NoSuchProviderException, .PrivateKey, .PublicKey, .SecureRandom, .Signature, .UnrecoverableKeyException, java.security.cert.Certificate, .CertificateEncodingException, .CertificateException, .CertificateFactory, .X509Certificate, java.security.interfaces.DSAKey, .RSAKey, java.security.spec.PKCS8EncodedKeySpec, java.text.ParseException, java.util.Date, .Enumeration, .HashMap, .HashSet, .Iterator, .Map, javax.crypto.BadPaddingException, .Cipher, .IllegalBlockSizeException, .Mac, .NoSuchPaddingException, .SecretKey, .SecretKeyFactory, javax.crypto.spec.SecretKeySpec, org.bouncycastle.asn1.ASN1Encodable, .ASN1Encoding, .ASN1InputStream, .ASN1ObjectIdentifier, .DERNull, org.bouncycastle.asn1.bc.EncryptedObjectStoreData, .EncryptedPrivateKeyData, .EncryptedSecretKeyData, .ObjectData, .ObjectDataSequence, .ObjectStore, .ObjectStoreData, .ObjectStoreIntegrityCheck, .PbkdMacIntegrityCheck, .SecretKeyData, .SignatureCheck, org.bouncycastle.internal.asn1.cms.CCMParameters, org.bouncycastle.asn1.kisa.KISAObjectIdentifiers, org.bouncycastle.asn1.misc.MiscObjectIdentifiers, .ScryptParams, org.bouncycastle.asn1.nist.NISTObjectIdentifiers, org.bouncycastle.asn1.nsri.NSRIObjectIdentifiers, org.bouncycastle.asn1.ntt.NTTObjectIdentifiers, org.bouncycastle.asn1.oiw.OIWObjectIdentifiers, org.bouncycastle.asn1.pkcs.EncryptedPrivateKeyInfo, .EncryptionScheme, .KeyDerivationFunc, .PBES2Parameters, .PBKDF2Params, .PKCSObjectIdentifiers, .PrivateKeyInfo, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .X509ObjectIdentifiers, org.bouncycastle.asn1.x9.X9ObjectIdentifiers, org.bouncycastle.crypto.CryptoServicesRegistrar, .PBEParametersGenerator, org.bouncycastle.crypto.digests.SHA3Digest, .SHA512Digest, org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator, .SCrypt, org.bouncycastle.crypto.params.KeyParameter, org.bouncycastle.crypto.util.PBKDF2Config, .PBKDFConfig, .ScryptConfig, org.bouncycastle.jcajce.BCFKSLoadStoreParameter, .BCFKSStoreParameter, .BCLoadStoreParameter, org.bouncycastle.jcajce.provider.keystore.util.AdaptingKeyStoreSpi, .ParameterUtil, org.bouncycastle.jcajce.util.BCJcaJceHelper, .DefaultJcaJceHelper, .JcaJceHelper, org.bouncycastle.jce.interfaces.ECKey, org.bouncycastle.util.Arrays, .Strings

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
private static class
private static class
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private static final BigInteger
private Date
private final Map<String, ObjectData>
private final JcaJceHelper
private AlgorithmIdentifier
private KeyDerivationFunc
private Date
private static final Map<String, ASN1ObjectIdentifier>
private static final BigInteger
private final Map<String, PrivateKey>
private static final BigInteger
private static final BigInteger
private static final Map<ASN1ObjectIdentifier, String>
private static final BigInteger
private AlgorithmIdentifier
private ASN1ObjectIdentifier
private BCFKSLoadStoreParameter.CertChainValidator
private PublicKey

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private byte[]
calculateMac(byte[] content, AlgorithmIdentifier algorithm, KeyDerivationFunc pbkdAlgorithm, char[] password)

private Cipher
createCipher(String algorithm, byte[] keyBytes)

private EncryptedPrivateKeyData
private Certificate
private byte[]
decryptData(String purpose, AlgorithmIdentifier protectAlgId, char[] password, byte[] encryptedData)

public Enumeration<String>
engineAliases()

Implements abstract java.security.KeyStoreSpi.engineAliases.

Lists all the alias names of this keystore.
public boolean
engineContainsAlias(String
the alias name
alias
)

Implements abstract java.security.KeyStoreSpi.engineContainsAlias.

Checks if the given alias exists in this keystore.
public void
engineDeleteEntry(String
the alias name
alias
)

Implements abstract java.security.KeyStoreSpi.engineDeleteEntry.

Deletes the entry identified by the given alias from this keystore.
public Certificate
engineGetCertificate(String
the alias name
s
)

Implements abstract java.security.KeyStoreSpi.engineGetCertificate.

Returns the certificate associated with the given alias.
public String
engineGetCertificateAlias(Certificate
the certificate to match with.
certificate
)

Implements abstract java.security.KeyStoreSpi.engineGetCertificateAlias.

Returns the (alias) name of the first keystore entry whose certificate matches the given certificate.
public Certificate[]
engineGetCertificateChain(String
the alias name
alias
)

Implements abstract java.security.KeyStoreSpi.engineGetCertificateChain.

Returns the certificate chain associated with the given alias.
public Date
engineGetCreationDate(String
the alias name
s
)

Implements abstract java.security.KeyStoreSpi.engineGetCreationDate.

Returns the creation date of the entry identified by the given alias.
public Key
engineGetKey(String
the alias name
alias
,
char[]
the password for recovering the key
password
)

Implements abstract java.security.KeyStoreSpi.engineGetKey.

Returns the key associated with the given alias, using the given password to recover it.
public boolean
engineIsCertificateEntry(String
the alias for the keystore entry to be checked
alias
)

Implements abstract java.security.KeyStoreSpi.engineIsCertificateEntry.

Returns true if the entry identified by the given alias was created by a call to setCertificateEntry, or created by a call to setEntry with a TrustedCertificateEntry.
public boolean
engineIsKeyEntry(String
the alias for the keystore entry to be checked
alias
)

Implements abstract java.security.KeyStoreSpi.engineIsKeyEntry.

Returns true if the entry identified by the given alias was created by a call to setKeyEntry, or created by a call to setEntry with a PrivateKeyEntry or a SecretKeyEntry.
public void
engineLoad(KeyStore.LoadStoreParameter
the KeyStore.LoadStoreParameter that specifies how to load the keystore, which may be null
parameter
)

Overrides java.security.KeyStoreSpi.engineLoad.

Loads the keystore using the given KeyStore.LoadStoreParameter.
public void
engineLoad(InputStream
the input stream from which the keystore is loaded, or null
inputStream
,
char[]
the password used to check the integrity of the keystore, the password used to unlock the keystore, or null
password
)

Implements abstract java.security.KeyStoreSpi.engineLoad.

Loads the keystore from the given input stream.
public void
engineSetCertificateEntry(String
the alias name
alias
,
Certificate
the certificate
certificate
)

Implements abstract java.security.KeyStoreSpi.engineSetCertificateEntry.

Assigns the given certificate to the given alias.
public void
engineSetKeyEntry(String
the alias name
alias
,
Key
the key to be associated with the alias
key
,
char[]
the password to protect the key
password
,
Certificate[]
the certificate chain for the corresponding public key (only required if the given key is of type java.security.PrivateKey).
chain
)

Implements abstract java.security.KeyStoreSpi.engineSetKeyEntry.

Assigns the given key to the given alias, protecting it with the given password.
public void
engineSetKeyEntry(String
the alias name
alias
,
byte[]
the key (in protected format) to be associated with the alias
keyBytes
,
Certificate[]
the certificate chain for the corresponding public key (only useful if the protected key is of type java.security.PrivateKey).
chain
)

Implements abstract java.security.KeyStoreSpi.engineSetKeyEntry.

Assigns the given key (that has already been protected) to the given alias.
public int
engineSize()

Implements abstract java.security.KeyStoreSpi.engineSize.

Retrieves the number of entries in this keystore.
public void
engineStore(KeyStore.LoadStoreParameter
the KeyStore.LoadStoreParameter that specifies how to store the keystore, which may be null
parameter
)

Overrides java.security.KeyStoreSpi.engineStore.

Stores this keystore using the given KeyStore.LoadStoreParameter.
public void
engineStore(OutputStream
the output stream to which this keystore is written.
outputStream
,
char[]
the password to generate the keystore integrity check. May be null if the keystore does not support or require an integrity check.
password
)

Implements abstract java.security.KeyStoreSpi.engineStore.

Stores this keystore to the given output stream, and protects its integrity with the given password.
private Date
extractCreationDate(ObjectData entry, Date creationDate)

private byte[]
generateKey(KeyDerivationFunc pbkdAlgorithm, String purpose, char[] password, int defKeySize)

private KeyDerivationFunc
generatePkbdAlgorithmIdentifier(PBKDFConfig pbkdfConfig, int keySizeInBytes)

private KeyDerivationFunc
private KeyDerivationFunc
generatePkbdAlgorithmIdentifier(ASN1ObjectIdentifier derivationAlgorithm, int keySizeInBytes)

private AlgorithmIdentifier
private SecureRandom
private EncryptedObjectStoreData
getEncryptedObjectStoreData(AlgorithmIdentifier integrityAlgorithm, char[] password)

private static String
private boolean
isSimilarHmacPbkd(PBKDFConfig storePBKDFConfig, KeyDerivationFunc hmacPkbdAlgorithm)

private void
verifyMac(byte[] content, PbkdMacIntegrityCheck integrityCheck, char[] password)

private void
verifySig(ASN1Encodable store, SignatureCheck integrityCheck, PublicKey key)

Inherited from java.security.KeyStoreSpi:
engineEntryInstanceOfengineGetAttributesengineGetEntryengineProbeengineSetEntry