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

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