Signature header object
Inheritance: Header
Example #1
0
        /// <summary>
        /// Sign the specified data with the specified key and construct
        /// the corresponding JWS object.
        /// </summary>
        /// <param name="Data">Data to be signed</param>
        /// <param name="SignatureKey">The signature key</param>
        public JoseWebSignature(byte [] Data, KeyPair SignatureKey) {
            Payload = Data;

            var Signer = SignatureKey.SignatureProvider;

            // if we wanted to change the digest provider
            // Signer.DigestAlgorithm = CryptoAlgorithmID.SHA_2_256;

            var PreHeader = new SignatureHeader(Signer);

            // This isn't working right now because the code does not
            // fetch the private key from the store.
            
            Payload = Data;
            Header = PreHeader.GetBytes(false);
            var SignatureValue = Signer.Sign(Payload);
            Signature = SignatureValue.Integrity;

            }