Module: Tem::ECert

Included in:
Session
Defined in:
lib/tem/ecert.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.ecert_tag(ecert) ⇒ Object

The tag contents for an endorsement certificate.



10
11
12
# File 'lib/tem/ecert.rb', line 10

def self.ecert_tag(ecert)
  { ecert_tag_key => ecert.to_der.unpack('C*') }
end

.ecert_tag_keyObject

The key storing the Endorsement Certificate in the TEM’s tag.



5
6
7
# File 'lib/tem/ecert.rb', line 5

def self.ecert_tag_key
  0x01
end

Instance Method Details

#endorsement_certObject

Retrieves the TEM’s Endorsement Certificate.



15
16
17
18
# File 'lib/tem/ecert.rb', line 15

def endorsement_cert
  raw_cert = tag[Tem::ECert.ecert_tag_key].pack('C*')
  OpenSSL::X509::Certificate.new raw_cert
end

#manufacturer_certObject

Retrieves the certificate of the TEM’s Manfacturer (CA).



21
22
23
# File 'lib/tem/ecert.rb', line 21

def manufacturer_cert
  Tem::CA.ca_cert
end

#pubekObject

Retrieves the TEM’s Public Endorsement Key.



26
27
28
# File 'lib/tem/ecert.rb', line 26

def pubek
  Tem::Key.new_from_ssl_key endorsement_cert.public_key
end