Exemplo n.º 1
0
        private SenderKeyState(UInt32 id, UInt32 iteration, byte[] chainKey,
		                       ECPublicKey signatureKeyPublic,
		                       Maybe<ECPrivateKey> signatureKeyPrivate)
        {
            var senderChainKeyStructure = new SenderKeyStateStructure.SenderChainKey {
                Iteration = (uint)iteration,
                Seed = chainKey
            };

            var signingKeyStructure = new SenderKeyStateStructure.SenderSigningKey {
                PublicKey = signatureKeyPublic.Serialize()
            };

            signatureKeyPrivate.Do (SKp => {
                signingKeyStructure.PrivateKey = SKp.Serialize();
            });

            Structure = new SenderKeyStateStructure {
                SenderKeyId = (uint)id,
                senderChainKey = senderChainKeyStructure,
                senderSigningKey = signingKeyStructure
            };
        }
Exemplo n.º 2
0
 public SenderKeyState(SenderKeyStateStructure structure)
 {
     Structure = structure;
 }