Class: TPM::CertifyValidator
- Inherits:
-
Object
- Object
- TPM::CertifyValidator
- Defined in:
- lib/tpm/certify_validator.rb
Constant Summary collapse
- TPM_SIGNATURE_ALG_TO_OPENSSL =
{ ALG_RSASSA => OpenSSL::SignatureAlgorithm::RSAPKCS1, ALG_RSAPSS => OpenSSL::SignatureAlgorithm::RSAPSS, ALG_ECDSA => OpenSSL::SignatureAlgorithm::ECDSA }.freeze
- TPM_HASH_ALG_TO_OPENSSL =
{ ALG_SHA1 => "SHA1", ALG_SHA256 => "SHA256", ALG_SHA384 => "SHA384", ALG_SHA512 => "SHA512" }.freeze
Instance Attribute Summary collapse
-
#hash_algorithm ⇒ Object
readonly
Returns the value of attribute hash_algorithm.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
-
#public_area ⇒ Object
readonly
Returns the value of attribute public_area.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#signature_algorithm ⇒ Object
readonly
Returns the value of attribute signature_algorithm.
Instance Method Summary collapse
-
#initialize(info, signature, nonce, public_area, signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256) ⇒ CertifyValidator
constructor
A new instance of CertifyValidator.
- #valid?(signing_key) ⇒ Boolean
Constructor Details
#initialize(info, signature, nonce, public_area, signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256) ⇒ CertifyValidator
Returns a new instance of CertifyValidator.
24 25 26 27 28 29 30 31 |
# File 'lib/tpm/certify_validator.rb', line 24 def initialize(info, signature, nonce, public_area, signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256) @info = info @signature = signature @nonce = nonce @public_area = public_area @signature_algorithm = signature_algorithm @hash_algorithm = hash_algorithm end |
Instance Attribute Details
#hash_algorithm ⇒ Object (readonly)
Returns the value of attribute hash_algorithm.
9 10 11 |
# File 'lib/tpm/certify_validator.rb', line 9 def hash_algorithm @hash_algorithm end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
9 10 11 |
# File 'lib/tpm/certify_validator.rb', line 9 def info @info end |
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
9 10 11 |
# File 'lib/tpm/certify_validator.rb', line 9 def nonce @nonce end |
#public_area ⇒ Object (readonly)
Returns the value of attribute public_area.
9 10 11 |
# File 'lib/tpm/certify_validator.rb', line 9 def public_area @public_area end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
9 10 11 |
# File 'lib/tpm/certify_validator.rb', line 9 def signature @signature end |
#signature_algorithm ⇒ Object (readonly)
Returns the value of attribute signature_algorithm.
9 10 11 |
# File 'lib/tpm/certify_validator.rb', line 9 def signature_algorithm @signature_algorithm end |
Instance Method Details
#valid?(signing_key) ⇒ Boolean
33 34 35 |
# File 'lib/tpm/certify_validator.rb', line 33 def valid?(signing_key) valid_info? && valid_signature?(signing_key) end |