Method: WSS4R::Security::Crypto::TripleDESSymmetricEncrypter#initialize

Defined in:
lib/wss4r/security/crypto/cipher.rb

#initialize(key = nil, iv = nil) ⇒ TripleDESSymmetricEncrypter

Returns a new instance of TripleDESSymmetricEncrypter.



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/wss4r/security/crypto/cipher.rb', line 60

def initialize(key = nil, iv = nil)
  @cipher = Cipher.new("DES-EDE3-CBC")
  if (iv == nil)
    @iv = @cipher.random_iv()
  else
    @iv = iv
  end
  if (key == nil)
    @key = @cipher.random_key()
  else
    @key = key
  end
end