TlsSigner.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. #if !BESTHTTP_DISABLE_ALTERNATE_SSL && (!UNITY_WEBGL || UNITY_EDITOR)
  2. using System;
  3. namespace Org.BouncyCastle.Crypto.Tls
  4. {
  5. public interface TlsSigner
  6. {
  7. void Init(TlsContext context);
  8. byte[] GenerateRawSignature(AsymmetricKeyParameter privateKey, byte[] md5AndSha1);
  9. byte[] GenerateRawSignature(SignatureAndHashAlgorithm algorithm,
  10. AsymmetricKeyParameter privateKey, byte[] hash);
  11. bool VerifyRawSignature(byte[] sigBytes, AsymmetricKeyParameter publicKey, byte[] md5AndSha1);
  12. bool VerifyRawSignature(SignatureAndHashAlgorithm algorithm, byte[] sigBytes,
  13. AsymmetricKeyParameter publicKey, byte[] hash);
  14. ISigner CreateSigner(AsymmetricKeyParameter privateKey);
  15. ISigner CreateSigner(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter privateKey);
  16. ISigner CreateVerifyer(AsymmetricKeyParameter publicKey);
  17. ISigner CreateVerifyer(SignatureAndHashAlgorithm algorithm, AsymmetricKeyParameter publicKey);
  18. bool IsValidPublicKey(AsymmetricKeyParameter publicKey);
  19. }
  20. }
  21. #endif