INNER CODE UNIT · Python

chain_length

kurtbrose/pyjks · jks/bks.py:313

            chain_length = b4.unpack_from(data, pos)[0]; pos += 4

            cert_chain = []
            for n in range(chain_length):
                entry, pos = cls._read_bks_cert(data, pos, store_type)
                cert_chain.append(entry)

            if _type == 1: # certificate
                entry, pos = cls._read_bks_cert(data, pos, store_type)
            elif _type == 2: # key: plaintext key entry, i.e. same as sealed key but without the PBEWithSHAAnd3KeyTripleDESCBC layer
                entry, pos = cls._read_bks_key(data, pos, store_type)
            elif _type == 3: # secret key: opaque arbitrary data blob, stored as-is by the keystore; can be anything (assumed to already be protected when supplied).
                entry, pos = cls._read_bks_secret(data, pos, store_type)
            elif _type == 4: # sealed key; a well-formatted certificate, private key or public key, encrypted by the BKS implementation with a standard algorithm at save time
                entry, pos = cls._read_bks_sealed(data, pos, store_type)
            else:
                raise BadKeystoreFormatException("Unexpected keystore entry type %d", tag)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…