Class: Ccrypto::Java::CrystalDilithiumKeyBundle
- Inherits:
-
Object
- Object
- Ccrypto::Java::CrystalDilithiumKeyBundle
- Includes:
- KeyBundle, TR::CondUtils
- Defined in:
- lib/ccrypto/java/engines/crystal_dilithium_engine.rb
Overview
Crystal-Dilithium mainly for data signing
Instance Method Summary collapse
-
#initialize(kp, param) ⇒ CrystalDilithiumKeyBundle
constructor
A new instance of CrystalDilithiumKeyBundle.
- #is_public_key_equal?(pubKey) ⇒ Boolean
- #private_key ⇒ Object
- #public_key ⇒ Object
Constructor Details
#initialize(kp, param) ⇒ CrystalDilithiumKeyBundle
Returns a new instance of CrystalDilithiumKeyBundle.
116 117 118 119 120 |
# File 'lib/ccrypto/java/engines/crystal_dilithium_engine.rb', line 116 def initialize(kp, param) @nativeKeypair = kp @param = param raise KeypairEngineException, "Given keypair is nil" if @param.nil? end |
Instance Method Details
#is_public_key_equal?(pubKey) ⇒ Boolean
136 137 138 |
# File 'lib/ccrypto/java/engines/crystal_dilithium_engine.rb', line 136 def is_public_key_equal?(pubKey) @nativeKeypair.getPublic().encoded == pubKey.encoded end |
#private_key ⇒ Object
129 130 131 132 133 134 |
# File 'lib/ccrypto/java/engines/crystal_dilithium_engine.rb', line 129 def private_key if @_privKey.nil? @_privKey = CrystalDilithiumPrivateKey.new(@nativeKeypair.getPrivate(), @param.param) end @_privKey end |
#public_key ⇒ Object
122 123 124 125 126 127 |
# File 'lib/ccrypto/java/engines/crystal_dilithium_engine.rb', line 122 def public_key if @_pubKey.nil? @_pubKey = CrystalDilithiumPublicKey.new(@nativeKeypair.getPublic(), @param.param) end @_pubKey end |