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.
33 lines
1.1 KiB
33 lines
1.1 KiB
using System;
|
|
|
|
using Org.BouncyCastle.Crypto.Parameters;
|
|
using Org.BouncyCastle.Crypto.Signers;
|
|
|
|
namespace Org.BouncyCastle.Tls.Crypto.Impl.BC
|
|
{
|
|
public class BcTlsEd448Verifier
|
|
: BcTlsVerifier
|
|
{
|
|
public BcTlsEd448Verifier(BcTlsCrypto crypto, Ed448PublicKeyParameters publicKey)
|
|
: base(crypto, publicKey)
|
|
{
|
|
}
|
|
|
|
public override bool VerifyRawSignature(DigitallySigned signature, byte[] hash)
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
public override TlsStreamVerifier GetStreamVerifier(DigitallySigned signature)
|
|
{
|
|
SignatureAndHashAlgorithm algorithm = signature.Algorithm;
|
|
if (algorithm == null || SignatureScheme.From(algorithm) != SignatureScheme.ed448)
|
|
throw new InvalidOperationException("Invalid algorithm: " + algorithm);
|
|
|
|
Ed448Signer verifier = new Ed448Signer(TlsUtilities.EmptyBytes);
|
|
verifier.Init(false, m_publicKey);
|
|
|
|
return new BcTlsStreamVerifier(verifier, signature.Signature);
|
|
}
|
|
}
|
|
}
|
|
|