Class: SyrupPay::Jwa::ContentEncryption
- Inherits:
-
Object
- Object
- SyrupPay::Jwa::ContentEncryption
- Includes:
- RandomKeyGen
- Defined in:
- lib/jose/jwa/enc/content_encryption.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#iv_length ⇒ Object
readonly
Returns the value of attribute iv_length.
-
#key_length ⇒ Object
readonly
Returns the value of attribute key_length.
Instance Method Summary collapse
- #content_encryption_generator ⇒ Object
- #generate_random_iv ⇒ Object
-
#initialize(key_length, iv_length) ⇒ ContentEncryption
constructor
A new instance of ContentEncryption.
Methods included from RandomKeyGen
Constructor Details
#initialize(key_length, iv_length) ⇒ ContentEncryption
Returns a new instance of ContentEncryption.
7 8 9 10 |
# File 'lib/jose/jwa/enc/content_encryption.rb', line 7 def initialize(key_length, iv_length) @key_length = key_length @iv_length = iv_length end |
Instance Attribute Details
#iv_length ⇒ Object (readonly)
Returns the value of attribute iv_length.
5 6 7 |
# File 'lib/jose/jwa/enc/content_encryption.rb', line 5 def iv_length @iv_length end |
#key_length ⇒ Object (readonly)
Returns the value of attribute key_length.
5 6 7 |
# File 'lib/jose/jwa/enc/content_encryption.rb', line 5 def key_length @key_length end |
Instance Method Details
#content_encryption_generator ⇒ Object
16 17 18 |
# File 'lib/jose/jwa/enc/content_encryption.rb', line 16 def content_encryption_generator SyrupPay::Jwa::ContentEncryptionKeyGenerator.new(@key_length) end |
#generate_random_iv ⇒ Object
12 13 14 |
# File 'lib/jose/jwa/enc/content_encryption.rb', line 12 def generate_random_iv randomKey(@iv_length/2) end |