AlgorithmIdentifier.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // AlgorithmIdentifier.cs - System.Security.Cryptography.Pkcs.AlgorithmIdentifier
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. using System;
  10. namespace System.Security.Cryptography.Pkcs {
  11. public sealed class AlgorithmIdentifier {
  12. private Oid _oid;
  13. private int _length;
  14. private byte[] _params;
  15. // constructors
  16. public AlgorithmIdentifier () : this (new Oid ("1.2.840.113549.3.7", "3des")) {}
  17. public AlgorithmIdentifier (Oid algorithm) : this (algorithm, 0) {}
  18. public AlgorithmIdentifier (Oid algorithm, int keyLength)
  19. {
  20. // FIXME: compatibility with fx 1.2.3400.0
  21. // if (algorithm == null)
  22. // throw new ArgumentNullException ("algorithm");
  23. _oid = algorithm;
  24. _length = keyLength;
  25. _params = new byte [0];
  26. }
  27. // properties
  28. public int KeyLength {
  29. get { return _length; }
  30. set { _length = value; }
  31. }
  32. public Oid Oid {
  33. get { return _oid; }
  34. set { _oid = value; }
  35. }
  36. public byte[] Parameters {
  37. get { return _params; }
  38. set { _params = value; }
  39. }
  40. }
  41. }