Example #1
0
 public KeyPair(IWif wif, IPrivateKeyFactory factory)
 {
     privateKey = factory.FromWif(wif.Get());
 }
Example #2
0
        public KeyPair(AuthorityClassification role, string userName, IPass password, IPrivateKeyFactory factory)
        {
            var buffer = new ByteBuffer(ByteBuffer.LITTLE_ENDING);
            var data   = Encoding.UTF8.GetBytes(userName.Trim());

            buffer.WriteBytes(data, false);
            data.Clear();
            data = GetRoleData(role);
            buffer.WriteBytes(data, false);
            data.Clear();
            data = password.Get();
            buffer.WriteBytes(data, false);
            data.Clear();
            var seed = buffer.ToArray();

            buffer.Dispose();
            privateKey = factory.FromSeed(seed);
            seed.Clear();
        }