protected SaltedOpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id) : base(id) { var saltBytes = new byte[SaltLength]; using (var rand = RandomNumberGenerator.Create()) { rand.GetBytes(saltBytes); } Salt = saltBytes; }
protected SaltedOpenPgpStringToKeySpecifier(Stream inputStream, OpenPgpStringToKeySpecifierId id) : base(id, inputStream) { var saltBytes = new byte[SaltLength]; if (inputStream.Read(saltBytes, 0, saltBytes.Length) <= 0) { throw new EndOfStreamException(); } Salt = saltBytes; }
protected OpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id) { Id = id; // SECREVIEW: Able to set this? HashAlgorithm = OpenPgpHashAlgorithm.DefaultHashAlgorithm; }
protected OpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id, Stream inputStream) : this(id) { HashAlgorithm = OpenPgpHashAlgorithm.GetHashAlgorithmById(inputStream.ReadByte()); }
protected SaltedOpenPgpStringToKeySpecifier(Stream inputStream, OpenPgpStringToKeySpecifierId id) : base(id, inputStream) { var saltBytes = new byte[SaltLength]; if(inputStream.Read(saltBytes, 0, saltBytes.Length) <= 0) { throw new EndOfStreamException(); } Salt = saltBytes; }
protected SaltedOpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id) : base(id) { var saltBytes = new byte[SaltLength]; using(var rand = RandomNumberGenerator.Create()) { rand.GetBytes(saltBytes); } Salt = saltBytes; }