setDecryptMetadata(encryption.isEncryptMetaData()); if (encryption.getLength() != 0) if (rid instanceof KeyTransRecipientId) appendCertInfo(extraInfo, (KeyTransRecipientId) rid, certificate, materialCert); setCurrentAccessPermission(currentAccessPermission); setAES(COSName.AESV2.equals(cryptFilterMethod) || COSName.AESV3.equals(cryptFilterMethod));
byte[] bytes = cipher.doFinal(in); KeyTransRecipientInfo recipientInfo = computeRecipientInfo(cert, secretkey.getEncoded()); DERSet set = new DERSet(new RecipientInfo(recipientInfo));
int version = computeVersionNumber(); dictionary.setVersion(version); byte[][] recipientsFields = computeRecipientsField(seed); mdResult = MessageDigests.getSHA256().digest(shaInput); COSName aesVName = version == 5 ? COSName.AESV3 : COSName.AESV2; prepareEncryptionDictAES(dictionary, aesVName, recipientsFields);
setDecryptMetadata(encryption.isEncryptMetaData()); if (encryption.getLength() != 0) if (rid instanceof KeyTransRecipientId) appendCertInfo(extraInfo, (KeyTransRecipientId) rid, certificate, materialCert); setCurrentAccessPermission(currentAccessPermission);
pkcs7input[23] = one; ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);
System.arraycopy(sk.getEncoded(), 0, seed, 0, 20); // create the 20 bytes seed byte[][] recipientsField = computeRecipientsField(seed); dictionary.setRecipients(recipientsField);
private void prepareEncryptionDictAES(PDEncryption encryptionDictionary, COSName aesVName, byte[][] recipients) { PDCryptFilterDictionary cryptFilterDictionary = new PDCryptFilterDictionary(); cryptFilterDictionary.setCryptFilterMethod(aesVName); cryptFilterDictionary.setLength(keyLength); COSArray array = new COSArray(); for (byte[] recipient : recipients) { array.add(new COSString(recipient)); } cryptFilterDictionary.getCOSDictionary().setItem(COSName.RECIPIENTS, array); encryptionDictionary.setDefaultCryptFilterDictionary(cryptFilterDictionary); encryptionDictionary.setStreamFilterName(COSName.DEFAULT_CRYPT_FILTER); encryptionDictionary.setStringFilterName(COSName.DEFAULT_CRYPT_FILTER); cryptFilterDictionary.getCOSDictionary().setDirect(true); setAES(true); }
setDecryptMetadata(encryption.isEncryptMetaData()); if (encryption.getLength() != 0) if (rid instanceof KeyTransRecipientId) appendCertInfo(extraInfo, (KeyTransRecipientId) rid, certificate, materialCert); setCurrentAccessPermission(currentAccessPermission);
pkcs7input[23] = one; ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);
byte[][] recipientsField = computeRecipientsField(seed); dictionary.setRecipients(recipientsField);
pkcs7input[23] = one; ASN1Primitive obj = createDERForRecipient(pkcs7input, certificate);
byte[] bytes = cipher.doFinal(in); KeyTransRecipientInfo recipientInfo = computeRecipientInfo(cert, secretkey.getEncoded()); DERSet set = new DERSet(new RecipientInfo(recipientInfo));
byte[] bytes = cipher.doFinal(in); KeyTransRecipientInfo recipientInfo = computeRecipientInfo(cert, secretkey.getEncoded()); DERSet set = new DERSet(new RecipientInfo(recipientInfo));