INNER CODE UNIT · Python
BksSecretKeyEntry
kurtbrose/pyjks · jks/bks.py:103
class BksSecretKeyEntry(AbstractBksEntry): # TODO: consider renaming this to SecretValueEntry, since it's arbitrary secret data
"""
Conceptually similar to, but not to be confused with, :class:`BksKeyEntry` objects of type :const:`KEY_TYPE_SECRET`:
- :class:`BksSecretKeyEntry` objects store the result of arbitrary user-supplied byte[]s, which, per the Java Keystore SPI, keystores are
obligated to assume have already been protected by the user in some unspecified way. Because of this assumption, no password is
provided for these entries when adding them to the keystore, and keystores are thus forced to store these bytes as-is.
Produced by a call to ``KeyStore.setKeyEntry(String alias, byte[] key, Certificate[] chain)`` call.
The bouncycastle project appears to have completely abandoned these entry types well over a decade ago now, and it is no
longer possible to retrieve these entries through the Java APIs in any (remotely) recent BC version.
- :class:`BksKeyEntry` objects of type :const:`KEY_TYPE_SECRET` store the result of a getEncoded() call on proper Java objects of type SecretKey.
Produced by a call to ``KeyStore.setKeyEntry(String alias, Key key, char[] password, Certificate[] chain)``.
The difference here is that the KeyStore implementation knows it's getting a proper (Secret)Key Java object, and can decide