public PKCS12SafeBagFactory(ContentInfo info) { if (info.getContentType().equals(PKCSObjectIdentifiers.encryptedData)) { throw new IllegalArgumentException("encryptedData requires constructor with decryptor."); } this.safeBagSeq = ASN1Sequence.getInstance(ASN1OctetString.getInstance(info.getContent()).getOctets()); }
public PKCS12SafeBagFactory(ContentInfo info) { if (info.getContentType().equals(PKCSObjectIdentifiers.encryptedData)) { throw new IllegalArgumentException("encryptedData requires constructor with decryptor."); } this.safeBagSeq = ASN1Sequence.getInstance(ASN1OctetString.getInstance(info.getContent()).getOctets()); }
public PKCS12SafeBagFactory(ContentInfo info, InputDecryptorProvider inputDecryptorProvider) throws PKCSException { if (info.getContentType().equals(PKCSObjectIdentifiers.encryptedData)) { CMSEncryptedData encData = new CMSEncryptedData(org.spongycastle.asn1.cms.ContentInfo.getInstance(info)); try { this.safeBagSeq = ASN1Sequence.getInstance(encData.getContent(inputDecryptorProvider)); } catch (CMSException e) { throw new PKCSException("unable to extract data: " + e.getMessage(), e); } return; } throw new IllegalArgumentException("encryptedData requires constructor with decryptor."); }
public PKCS12SafeBagFactory(ContentInfo info, InputDecryptorProvider inputDecryptorProvider) throws PKCSException { if (info.getContentType().equals(PKCSObjectIdentifiers.encryptedData)) { CMSEncryptedData encData = new CMSEncryptedData(org.spongycastle.asn1.cms.ContentInfo.getInstance(info)); try { this.safeBagSeq = ASN1Sequence.getInstance(encData.getContent(inputDecryptorProvider)); } catch (CMSException e) { throw new PKCSException("unable to extract data: " + e.getMessage(), e); } return; } throw new IllegalArgumentException("encryptedData requires constructor with decryptor."); }
info = new ContentInfo(info.getContentType(), new DEROctetString(bOut.toByteArray()));
info = new ContentInfo(info.getContentType(), new DEROctetString(bOut.toByteArray()));
localIds = new Hashtable(); if (info.getContentType().equals(data)) if (c[i].getContentType().equals(data)) else if (c[i].getContentType().equals(encryptedData)) System.out.println("extra " + c[i].getContentType().getId()); System.out.println("extra " + ASN1Dump.dumpAsString(c[i].getContent()));
localIds = new Hashtable(); if (info.getContentType().equals(data)) if (c[i].getContentType().equals(data)) else if (c[i].getContentType().equals(encryptedData)) System.out.println("extra " + c[i].getContentType().getId()); System.out.println("extra " + ASN1Dump.dumpAsString(c[i].getContent()));