SignatureDescription.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // System.Security.Cryptography SignatureDescription Class implementation
  3. //
  4. // Authors:
  5. // Thomas Neidhart ([email protected])
  6. //
  7. // LAMESPEC: documentation of this class is completely missing in the sdk doc
  8. // TODO: Implement AsymmetricSignatureFormatter & AsymmetricSignatureDeformatter methods
  9. using System;
  10. using System.Security;
  11. namespace System.Security.Cryptography {
  12. /// <summary>
  13. /// LAMESPEC: no sdk doc available for this class by the time of beta 2
  14. /// </summary>
  15. [MonoTODO]
  16. public class SignatureDescription {
  17. private string _DeformatterAlgorithm;
  18. private string _DigestAlgorithm;
  19. private string _FormatterAlgorithm;
  20. private string _KeyAlgorithm;
  21. /// <summary>
  22. /// LAMESPEC: no idea what param el should do??
  23. /// </summary>
  24. public SignatureDescription (SecurityElement el) {
  25. if (el == null)
  26. throw new CryptographicException();
  27. }
  28. /// <summary>
  29. /// LAMESPEC: what to do if setting null values?
  30. /// </summary>
  31. public string DeformatterAlgorithm {
  32. get {
  33. return _DeformatterAlgorithm;
  34. }
  35. set {
  36. _DeformatterAlgorithm = value;
  37. }
  38. }
  39. /// <summary>
  40. /// LAMESPEC: what to do if setting null values?
  41. /// </summary>
  42. public string DigestAlgorithm {
  43. get {
  44. return _DigestAlgorithm;
  45. }
  46. set {
  47. _DigestAlgorithm = value;
  48. }
  49. }
  50. /// <summary>
  51. /// LAMESPEC: what to do if setting null values?
  52. /// </summary>
  53. public string FormatterAlgorithm {
  54. get {
  55. return _FormatterAlgorithm;
  56. }
  57. set {
  58. _FormatterAlgorithm = value;
  59. }
  60. }
  61. /// <summary>
  62. /// LAMESPEC: what to do if setting null values?
  63. /// </summary>
  64. public string KeyAlgorithm {
  65. get {
  66. return _KeyAlgorithm;
  67. }
  68. set {
  69. _KeyAlgorithm = value;
  70. }
  71. }
  72. [MonoTODO]
  73. public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key)
  74. {
  75. // TODO: Implement
  76. return null;
  77. }
  78. /// <summary>
  79. /// Create the hash algorithm assigned with this object
  80. /// </summary>
  81. public virtual HashAlgorithm CreateDigest()
  82. {
  83. return HashAlgorithm.Create(_DigestAlgorithm);
  84. }
  85. [MonoTODO]
  86. public virtual AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key)
  87. {
  88. // TODO: Implement
  89. return null;
  90. }
  91. } // SignatureDescription
  92. } // System.Security.Cryptography