Exemple #1
0
        public JWS(RSA rsa)
        {
            this.rsa = rsa ?? throw new ArgumentNullException(nameof(rsa));

            var publicParameters = rsa.ExportParameters(includePrivateParameters: false);

            this.jwk = new JWK {
                KeyType  = "RSA",
                Exponent = publicParameters.Exponent.Base64UrlEncoded(),
                Modulus  = publicParameters.Modulus.Base64UrlEncoded(),
            };
        }
Exemple #2
0
 public JWSHeader(string algorithm, JWK key)
 {
     Algorithm = algorithm;
     Key       = key;
 }