public override bool Equals(object obj) { if (obj == this) { return(true); } PgpUserAttributeSubpacketVector pgpUserAttributeSubpacketVector = obj as PgpUserAttributeSubpacketVector; if (pgpUserAttributeSubpacketVector == null) { return(false); } if (pgpUserAttributeSubpacketVector.packets.Length != packets.Length) { return(false); } for (int i = 0; i != packets.Length; i++) { if (!pgpUserAttributeSubpacketVector.packets[i].Equals(packets[i])) { return(false); } } return(true); }
public PgpSignature GenerateCertification(PgpUserAttributeSubpacketVector userAttributes, PgpPublicKey pubKey) { UpdateWithPublicKey(pubKey); try { MemoryStream memoryStream = new MemoryStream(); UserAttributeSubpacket[] array = userAttributes.ToSubpacketArray(); foreach (UserAttributeSubpacket userAttributeSubpacket in array) { userAttributeSubpacket.Encode(memoryStream); } UpdateWithIdData(209, memoryStream.ToArray()); } catch (IOException exception) { throw new PgpException("cannot encode subpacket array", exception); } return(Generate()); }
public bool VerifyCertification(PgpUserAttributeSubpacketVector userAttributes, PgpPublicKey key) { UpdateWithPublicKey(key); try { MemoryStream memoryStream = new MemoryStream(); UserAttributeSubpacket[] array = userAttributes.ToSubpacketArray(); foreach (UserAttributeSubpacket userAttributeSubpacket in array) { userAttributeSubpacket.Encode(memoryStream); } UpdateWithIdData(209, memoryStream.ToArray()); } catch (IOException exception) { throw new PgpException("cannot encode subpacket array", exception); } Update(sigPck.GetSignatureTrailer()); return(sig.VerifySignature(GetSignature())); }