public override void Encode(IBcpgOutputStream bcpgOut) { base.Encode(bcpgOut); bcpgOut.WriteByte(0x3); bcpgOut.WriteByte(this.Reserved); bcpgOut.WriteByte((byte)this.HashAlgorithm); bcpgOut.WriteByte((byte)this.SymmetricKeyAlgorithm); }
public override void Encode(IBcpgOutputStream bcpgOut) { bcpgOut.WriteByte((byte)_type); bcpgOut.WriteByte((byte)_algorithm); if (_type != GnuDummyS2K) { if (_type != 0) { bcpgOut.Write(_iv); } if (_type == 3) { bcpgOut.WriteByte((byte)_itCount); } } else { bcpgOut.WriteByte((byte)'G'); bcpgOut.WriteByte((byte)'N'); bcpgOut.WriteByte((byte)'U'); bcpgOut.WriteByte((byte)_protectionMode); } }
/// <summary> /// Encodes the specified BCPG out. /// </summary> /// <param name="bcpgOut">The BCPG out.</param> public override void Encode(IBcpgOutputStream bcpgOut) { var oid = this.Oid.ToBytes(); bcpgOut.WriteByte((byte)oid.Length); bcpgOut.Write(oid, 0, oid.Length); var point = new MPInteger(new BigInteger(1, _point.GetEncoded())); bcpgOut.WriteObject(point); }
public override void Encode(IBcpgOutputStream bcpgOut) { bcpgOut.WriteByte((byte) _type); bcpgOut.WriteByte((byte) _algorithm); if (_type != GnuDummyS2K) { if (_type != 0) { bcpgOut.Write(_iv); } if (_type == 3) { bcpgOut.WriteByte((byte) _itCount); } } else { bcpgOut.WriteByte((byte) 'G'); bcpgOut.WriteByte((byte) 'N'); bcpgOut.WriteByte((byte) 'U'); bcpgOut.WriteByte((byte) _protectionMode); } }