Example #1
0
 public PgpSignature(PgpPacket FromPacket, PgpPublicKey PublicMasterKeyPacket, PgpUserId UserIdPacket, List <PgpToken> ltTokens, EncryptionServices Cryptography) : base(FromPacket)
 {
     Initialise(nSignatureType.PositiveCertification);
     _PublicKeyPacket = PublicMasterKeyPacket;
     _UserIdPacket    = UserIdPacket;
     _Cryptography    = Cryptography;
     Parse(_PublicKeyPacket, ltTokens);
 }
Example #2
0
 /// <summary></summary>
 private void HashUserIdData(MemoryStream StreamToHash, PgpUserId UserId)
 {
     StreamToHash.WriteByte(cbUserIdCertificationTag);
     StreamToHash.WriteByte((byte)((UserId.iDataLength >> 24) & 0xff));
     StreamToHash.WriteByte((byte)((UserId.iDataLength >> 16) & 0xff));
     StreamToHash.WriteByte((byte)((UserId.iDataLength >> 8) & 0xff));
     StreamToHash.WriteByte((byte)(UserId.iDataLength & 0xff));
     StreamToHash.Write(UserId.abRawBytes, UserId.iHeaderLength, UserId.iDataLength);
 }
Example #3
0
 /// <summary>Base constructor for initialisation.</summary>
 private PgpToken(EncryptionServices Cryptography)
 {
     _eStatus      = nStatus.Undefined;
     _eType        = nType.Undefined;
     _sSlotName    = string.Empty;
     _TokenInfo    = null;
     _UserIdPacket = null;
     _Cryptography = Cryptography;
     _KeyPacket    = null;
     _ltSubkeys    = new List <PgpSignature>();
 }
Example #4
0
 /// <summary></summary>
 private void Initialise(nSignatureType eSignatureType)
 {
     _abFingerprint       = _abHashFingerprint = _abSignature = null;
     _iHashedLength       = _iSignatureBits = 0;
     _eVerified           = nVerified.Pending;
     _eSignatureType      = eSignatureType;
     _eTranslatedKeyFlags = nTranslatedKeyFlags.None;
     _ePublicKeyAlgorithm = nPublicKeyAlgorithm.RsaEncryptOrSign;
     _eHashAlgorithm      = nHashAlgorithm.Sha512;
     _PrivateKeyPacket    = null;
     _PublicKeyPacket     = null;
     _UserIdPacket        = null;
     _Cryptography        = null;
     _ltSubpackets        = new List <PgpSignatureSubpacket>();
 }
Example #5
0
        private PgpPacket ParseUserIdPacket(PgpPacket RawPgpPacket)
        {
            PgpPacket ReturnPaket = null;

            if (_UserIdPacket == null)
            {
                ReturnPaket = new PgpUserId(RawPgpPacket);

                if ((ReturnPaket != null) && (ReturnPaket.eStatus == PgpPacketBase.nStatus.OK))
                {
                    _UserIdPacket = (PgpUserId)ReturnPaket;
                }
            }
            return(ReturnPaket);
        }