示例#1
0
        protected SaltedOpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id) : base(id)
        {
            var saltBytes = new byte[SaltLength];

            using (var rand = RandomNumberGenerator.Create()) {
                rand.GetBytes(saltBytes);
            }
            Salt = saltBytes;
        }
示例#2
0
        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;
        }
示例#3
0
 protected OpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id)
 {
     Id = id;
     // SECREVIEW: Able to set this?
     HashAlgorithm = OpenPgpHashAlgorithm.DefaultHashAlgorithm;
 }
示例#4
0
 protected OpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id, Stream inputStream) : this(id) {
     HashAlgorithm = OpenPgpHashAlgorithm.GetHashAlgorithmById(inputStream.ReadByte());
 }
示例#5
0
 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;
 }
示例#6
0
 protected SaltedOpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id)
     : base(id)
 {
     var saltBytes = new byte[SaltLength];
     using(var rand = RandomNumberGenerator.Create()) {
         rand.GetBytes(saltBytes);
     }
     Salt = saltBytes;
 }
示例#7
0
 protected OpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id)
 {
     Id = id;
     // SECREVIEW: Able to set this?
     HashAlgorithm = OpenPgpHashAlgorithm.DefaultHashAlgorithm;
 }
示例#8
0
 protected OpenPgpStringToKeySpecifier(OpenPgpStringToKeySpecifierId id, Stream inputStream)
     : this(id)
 {
     HashAlgorithm = OpenPgpHashAlgorithm.GetHashAlgorithmById(inputStream.ReadByte());
 }