Class: TPM::KeyAttestation
- Inherits:
-
Object
- Object
- TPM::KeyAttestation
- Defined in:
- lib/tpm/key_attestation.rb,
lib/tpm/key_attestation/version.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- TRUSTED_CERTIFICATES =
begin pattern = File.(File.join(__dir__, "certificates", "*", "RootCA", "*.*")) Dir.glob(pattern).map do |filename| File.open(filename) { |file| OpenSSL::X509::Certificate.new(file) } end end
- VERSION =
"0.12.0"
Instance Attribute Summary collapse
-
#certificates ⇒ Object
readonly
Returns the value of attribute certificates.
-
#certified_key ⇒ Object
readonly
Returns the value of attribute certified_key.
-
#certify_info ⇒ Object
readonly
Returns the value of attribute certify_info.
-
#hash_algorithm ⇒ Object
readonly
Returns the value of attribute hash_algorithm.
-
#qualifying_data ⇒ Object
readonly
Returns the value of attribute qualifying_data.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
-
#signature_algorithm ⇒ Object
readonly
Returns the value of attribute signature_algorithm.
-
#trusted_certificates ⇒ Object
readonly
Returns the value of attribute trusted_certificates.
Instance Method Summary collapse
-
#initialize(certify_info, signature, certified_key, certificates, qualifying_data, signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256, trusted_certificates: TRUSTED_CERTIFICATES) ⇒ KeyAttestation
constructor
A new instance of KeyAttestation.
- #key ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(certify_info, signature, certified_key, certificates, qualifying_data, signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256, trusted_certificates: TRUSTED_CERTIFICATES) ⇒ KeyAttestation
Returns a new instance of KeyAttestation.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/tpm/key_attestation.rb', line 35 def initialize( certify_info, signature, certified_key, certificates, , signature_algorithm: ALG_RSASSA, hash_algorithm: ALG_SHA256, trusted_certificates: TRUSTED_CERTIFICATES ) @certify_info = certify_info @signature = signature @certified_key = certified_key @certificates = certificates @signature_algorithm = signature_algorithm @hash_algorithm = hash_algorithm @qualifying_data = @trusted_certificates = trusted_certificates end |
Instance Attribute Details
#certificates ⇒ Object (readonly)
Returns the value of attribute certificates.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def certificates @certificates end |
#certified_key ⇒ Object (readonly)
Returns the value of attribute certified_key.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def certified_key @certified_key end |
#certify_info ⇒ Object (readonly)
Returns the value of attribute certify_info.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def certify_info @certify_info end |
#hash_algorithm ⇒ Object (readonly)
Returns the value of attribute hash_algorithm.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def hash_algorithm @hash_algorithm end |
#qualifying_data ⇒ Object (readonly)
Returns the value of attribute qualifying_data.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def @qualifying_data end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def signature @signature end |
#signature_algorithm ⇒ Object (readonly)
Returns the value of attribute signature_algorithm.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def signature_algorithm @signature_algorithm end |
#trusted_certificates ⇒ Object (readonly)
Returns the value of attribute trusted_certificates.
24 25 26 |
# File 'lib/tpm/key_attestation.rb', line 24 def trusted_certificates @trusted_certificates end |
Instance Method Details
#key ⇒ Object
56 57 58 59 60 |
# File 'lib/tpm/key_attestation.rb', line 56 def key if valid? public_area.key end end |
#valid? ⇒ Boolean
62 63 64 65 66 |
# File 'lib/tpm/key_attestation.rb', line 62 def valid? certify_validator.valid?(aik_certificate.public_key) && aik_certificate.conformant? && trustworthy? end |