Ejemplo n.º 1
0
 public EncryptionConfig(UserAccessPermissions perms)
 {
     this.m_IsEncrypt     = false;
     this.m_OwnerPassword = null;
     this.m_UserPassword  = null;
     this.m_Permissions   = perms;
 }
Ejemplo n.º 2
0
        private PDFString CreateRecipientString(X509Certificate cert, UserAccessPermissions perm, int keyLength)
        {
            PDFString text1 = Library.CreateString("");
            ASN1      asn1  = new ASN1(48);

            asn1.Add(ASN1Convert.FromOID("1.2.840.113549.1.7.3"));
            ASN1 asn2 = new ASN1(160);

            byte[] numArray1 = new byte[1];
            asn2.Add(new ASN1(2, numArray1));
            ASN1 asn3 = new ASN1(48);
            ASN1 asn4 = new ASN1(48);

            asn3.Add(asn4);
            new ASN1(2, cert.GetSerialNumber());
            return(text1);
        }
Ejemplo n.º 3
0
 public EncryptionDictionary(string filter, EncryptionAlgorithmCode encryptionAlgorithmCode,
                             int?keyLength,
                             int revision,
                             byte[] ownerBytes,
                             byte[] userBytes,
                             byte[] ownerEncryptionBytes,
                             byte[] userEncryptionBytes,
                             UserAccessPermissions userAccessPermissions,
                             DictionaryToken dictionary,
                             bool encryptMetadata)
 {
     Filter = filter;
     EncryptionAlgorithmCode = encryptionAlgorithmCode;
     KeyLength             = keyLength;
     Revision              = revision;
     OwnerBytes            = ownerBytes;
     UserBytes             = userBytes;
     OwnerEncryptionBytes  = ownerEncryptionBytes;
     UserEncryptionBytes   = userEncryptionBytes;
     UserAccessPermissions = userAccessPermissions;
     Dictionary            = dictionary;
     EncryptMetadata       = encryptMetadata;
 }
Ejemplo n.º 4
0
        public static EncryptionStandard Create(string ownerPassword, string userPassword, UserAccessPermissions perm, int keyLength, bool encMetadata)
        {
            if (ownerPassword == null)
            {
                ownerPassword = "";
            }
            if (userPassword == null)
            {
                userPassword = "";
            }
            EncryptionStandard standard1 = new EncryptionStandard();

            standard1.mUserPassword  = userPassword;
            standard1.mOwnerPassword = ownerPassword;
            standard1.mPerm          = ((uint)perm);
            standard1.mKeyLength     = keyLength;
            standard1.mRev           = 3;
            standard1.mV             = 2;
            standard1.mEncMetadata   = encMetadata;
            return(standard1);
        }