iTextSharp.text.pdf.PdfEncryption.DecryptByteArray C# (CSharp) Метод

DecryptByteArray() публичный Метод

public DecryptByteArray ( byte b ) : byte[]
b byte
Результат byte[]
        public byte[] DecryptByteArray(byte[] b)
        {
            MemoryStream ba = new MemoryStream();
            StandardDecryption dec = GetDecryptor();
            byte[] b2 = dec.Update(b, 0, b.Length);
            if (b2 != null)
            ba.Write(b2, 0, b2.Length);
            b2 = dec.Finish();
            if (b2 != null)
            ba.Write(b2, 0, b2.Length);
            return ba.ToArray();
        }

Usage Example

Пример #1
0
        internal void Decrypt(PdfReader reader)
        {
            PdfEncryption decrypt = reader.Decrypt;

            if (decrypt != null)
            {
                originalValue = value;
                decrypt.SetHashKey(objNum, objGen);
                bytes = PdfEncodings.ConvertToBytes(value, null);
                bytes = decrypt.DecryptByteArray(bytes);
                value = PdfEncodings.ConvertToString(bytes, null);
            }
        }
All Usage Examples Of iTextSharp.text.pdf.PdfEncryption::DecryptByteArray