Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit bee878a

Browse files
author
Atsushi Kanamori
committed
Implement ECDsa and ECDsaCng
1 parent a28c280 commit bee878a

File tree

20 files changed

+1124
-87
lines changed

20 files changed

+1124
-87
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
namespace System.Security.Cryptography.EcDsa.Tests
5+
{
6+
public interface IECDsaProvider
7+
{
8+
ECDsa Create();
9+
ECDsa Create(int keySize);
10+
}
11+
12+
public static partial class ECDsaFactory
13+
{
14+
public static ECDsa Create()
15+
{
16+
return s_provider.Create();
17+
}
18+
19+
public static ECDsa Create(int keySize)
20+
{
21+
return s_provider.Create(keySize);
22+
}
23+
}
24+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System;
5+
using System.IO;
6+
using System.Security.Cryptography;
7+
8+
namespace System.Security.Cryptography.EcDsa.Tests
9+
{
10+
// Stub out the last remaining abstract members to throw NotImplementedException
11+
internal class ECDsaStub : ECDsa
12+
{
13+
public override byte[] SignHash(byte[] hash)
14+
{
15+
return Array.Empty<byte>();
16+
}
17+
18+
public override bool VerifyHash(byte[] hash, byte[] signature)
19+
{
20+
return false;
21+
}
22+
23+
protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm)
24+
{
25+
throw new NotImplementedException();
26+
}
27+
28+
protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm)
29+
{
30+
throw new NotImplementedException();
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)