blob: a161a6a186f59fda7436f49a8ff6520281006fac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==
using System;
namespace System.Security.Cryptography {
/// <summary>
/// Base class for implementations of elliptic curve DSA
/// </summary>
[System.Security.Permissions.HostProtection(MayLeakOnAbort = true)]
public abstract class ECDsa : AsymmetricAlgorithm {
public override string KeyExchangeAlgorithm {
get { return null; }
}
public override string SignatureAlgorithm {
get { return "ECDsa"; }
}
//
// Creation factory methods
//
public static new ECDsa Create() {
#if MONO
throw new NotImplementedException ();
#else
return Create(typeof(ECDsaCng).FullName);
#endif
}
public static new ECDsa Create(string algorithm) {
if (algorithm == null) {
throw new ArgumentNullException("algorithm");
}
return CryptoConfig.CreateFromName(algorithm) as ECDsa;
}
//
// Signature operations
//
public abstract byte[] SignHash(byte[] hash);
public abstract bool VerifyHash(byte[] hash, byte[] signature);
}
}
|