Esempio n. 1
0
 protected internal virtual byte[] DecodeContent()
 {
     byte[] decodedBytes = PdfTokenizer.DecodeStringContent(content, hexWriting);
     if (decryption != null && !CheckState(PdfObject.UNENCRYPTED))
     {
         decryption.SetHashKeyForNextObject(decryptInfoNum, decryptInfoGen);
         decodedBytes = decryption.DecryptByteArray(decodedBytes);
     }
     return(decodedBytes);
 }
Esempio n. 2
0
 /// <summary>
 /// Decrypt content of an encrypted
 /// <c>PdfString</c>
 /// .
 /// </summary>
 protected internal virtual iText.Kernel.Pdf.PdfString Decrypt(PdfEncryption decrypt)
 {
     if (decrypt != null)
     {
         System.Diagnostics.Debug.Assert(content != null, "No byte content to decrypt value");
         byte[] decodedContent = PdfTokenizer.DecodeStringContent(content, hexWriting);
         content = null;
         decrypt.SetHashKeyForNextObject(decryptInfoNum, decryptInfoGen);
         value = PdfEncodings.ConvertToString(decrypt.DecryptByteArray(decodedContent), null);
     }
     return(this);
 }