示例#1
0
 public MagicEnvelope(string data, string type, MagicKey key)
 {
     _data      = _encodeBase64Url(Encoding.UTF8.GetBytes(data));
     _dataType  = type;
     _alg       = "RSA-SHA256";
     _encoding  = "base64url";
     _signature = _encodeBase64Url(key.Sign(key.BuildSignedData(_data, _dataType, _encoding, _alg)));
 }
示例#2
0
 public bool VerifySignatureAgainst(MagicKey key)
 {
     return(key.Verify(_signature, key.BuildSignedData(_data, _dataType, _encoding, _alg)));
 }