You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1006 B
32 lines
1006 B
using System;
|
|
|
|
using Org.BouncyCastle.Crypto.Parameters;
|
|
using Org.BouncyCastle.Crypto.Signers;
|
|
|
|
namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
|
|
{
|
|
public class BcTlsEd448Signer
|
|
: BcTlsSigner
|
|
{
|
|
public BcTlsEd448Signer(BcTlsCrypto crypto, Ed448PrivateKeyParameters privateKey)
|
|
: base(crypto, privateKey)
|
|
{
|
|
}
|
|
|
|
public override byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm, byte[] hash)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
public override TlsStreamSigner GetStreamSigner(SignatureAndHashAlgorithm algorithm)
|
|
{
|
|
if (algorithm == null || SignatureScheme.From(algorithm) != SignatureScheme.ed448)
|
|
throw new InvalidOperationException("Invalid algorithm: " + algorithm);
|
|
|
|
Ed448Signer signer = new Ed448Signer(TlsUtilities.EmptyBytes);
|
|
signer.Init(true, m_privateKey);
|
|
|
|
return new BcTlsStreamSigner(signer);
|
|
}
|
|
}
|
|
}
|
|
|