public static ObjectStoreData getInstance(Object o) { if (o instanceof ObjectStoreData) { return (ObjectStoreData)o; } else if (o != null) { return new ObjectStoreData(ASN1Sequence.getInstance(o)); } return null; }
AlgorithmIdentifier protectAlgId = encryptedStoreData.getEncryptionAlgorithm(); storeData = ObjectStoreData.getInstance(decryptData("STORE_ENCRYPTION", protectAlgId, password, encryptedStoreData.getEncryptedContent().getOctets())); storeData = ObjectStoreData.getInstance(sData); creationDate = storeData.getCreationDate().getDate(); lastModifiedDate = storeData.getLastModifiedDate().getDate(); if (!storeData.getIntegrityAlgorithm().equals(integrityAlg)) for (Iterator it = storeData.getObjectDataSequence().iterator(); it.hasNext(); )
byte[] keyBytes = generateKey(pbkdAlgId, "STORE_ENCRYPTION", ((password != null) ? password : new char[0]), 256 / 8); ObjectStoreData storeData = new ObjectStoreData(integrityAlgorithm, creationDate, lastModifiedDate, new ObjectDataSequence(dataArray), null); EncryptedObjectStoreData encStoreData; byte[] encOut = c.doFinal(storeData.getEncoded()); byte[] encOut = c.doFinal(storeData.getEncoded()); PBES2Parameters pbeParams = new PBES2Parameters(pbkdAlgId, new EncryptionScheme(NISTObjectIdentifiers.id_aes256_wrap_pad));
private ObjectStore(ASN1Sequence seq) { if (seq.size() != 2) { throw new IllegalArgumentException("malformed sequence"); } ASN1Encodable sData = seq.getObjectAt(0); if (sData instanceof EncryptedObjectStoreData) { this.storeData = sData; } else if (sData instanceof ObjectStoreData) { this.storeData = sData; } else { ASN1Sequence seqData = ASN1Sequence.getInstance(sData); if (seqData.size() == 2) { this.storeData = EncryptedObjectStoreData.getInstance(seqData); } else { this.storeData = ObjectStoreData.getInstance(seqData); } } this.integrityCheck = ObjectStoreIntegrityCheck.getInstance(seq.getObjectAt(1)); }