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); }
/// <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); }
/// <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>(); }
/// <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>(); }
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); }