SignerInfo.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // SignerInfo.cs - System.Security.Cryptography.Pkcs.SignerInfo
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. #if NET_1_2
  10. using System;
  11. using System.Security.Cryptography.X509Certificates;
  12. namespace System.Security.Cryptography.Pkcs {
  13. public class SignerInfo {
  14. private SubjectIdentifier _signer;
  15. private X509CertificateEx _certificate;
  16. private Oid _digest;
  17. private SignerInfoCollection _counter;
  18. private Pkcs9AttributeCollection _auth;
  19. private Pkcs9AttributeCollection _unauth;
  20. private int _version;
  21. // only accessible from SignedPkcs7.SignerInfos
  22. internal SignerInfo (string hashOid, X509CertificateEx certificate, SubjectIdentifierType type, object o, int version)
  23. {
  24. _digest = new Oid (hashOid);
  25. _certificate = certificate;
  26. _counter = new SignerInfoCollection ();
  27. _auth = new Pkcs9AttributeCollection ();
  28. _unauth = new Pkcs9AttributeCollection ();
  29. _signer = new SubjectIdentifier (type, o);
  30. _version = version;
  31. }
  32. // properties
  33. public Pkcs9AttributeCollection AuthenticatedAttributes {
  34. get { return _auth; }
  35. }
  36. public X509CertificateEx Certificate {
  37. get { return _certificate; }
  38. }
  39. public SignerInfoCollection CounterSignerInfos {
  40. get { return _counter; }
  41. }
  42. public Oid DigestAlgorithm {
  43. get { return _digest; }
  44. }
  45. public SubjectIdentifier SignerIdentifier {
  46. get { return _signer; }
  47. }
  48. public Pkcs9AttributeCollection UnauthenticatedAttributes {
  49. get { return _unauth; }
  50. }
  51. public int Version {
  52. get { return _version; }
  53. }
  54. // methods
  55. [MonoTODO]
  56. public void CheckSignature (bool verifySignatureOnly) {}
  57. [MonoTODO]
  58. public void CheckSignature (X509CertificateExCollection extraStore, bool verifySignatureOnly) {}
  59. [MonoTODO]
  60. public void ComputeCounterSignature () {}
  61. [MonoTODO]
  62. public void ComputeCounterSignature (Pkcs7Signer signer) {}
  63. [MonoTODO]
  64. public void RemoveCounterSignature (SignerInfo counterSignerInfo) {}
  65. }
  66. }
  67. #endif