Example usage for org.bouncycastle.pkcs PKCS12SafeBag getAttributes

List of usage examples for org.bouncycastle.pkcs PKCS12SafeBag getAttributes

Introduction

In this page you can find the example usage for org.bouncycastle.pkcs PKCS12SafeBag getAttributes.

Prototype

public Attribute[] getAttributes() 

Source Link

Usage

From source file:de.carne.certmgr.store.provider.bouncycastle.PKCS12Decoder.java

License:Open Source License

private void decodeBags(PKCS12SafeBag[] bags) throws PasswordRequiredException {
    for (PKCS12SafeBag bag : bags) {
        Object bagValue = bag.getBagValue();

        if (bagValue instanceof X509CertificateHolder) {
            decodeCRTBag((X509CertificateHolder) bagValue, bag.getAttributes());
        } else if (bagValue instanceof PKCS8EncryptedPrivateKeyInfo) {
            decodeKeyBag((PKCS8EncryptedPrivateKeyInfo) bagValue, bag.getAttributes());
        } else if (bagValue instanceof PrivateKeyInfo) {
            decodeKeyBag((PrivateKeyInfo) bagValue, bag.getAttributes());
        } else {/*ww w .  ja v a 2  s .  co  m*/
            LOG.info(null, "Ignoring unexpected bag type: {0}", bagValue.getClass());
        }
    }
}