Class: RStyx::Keyring::Authinfo
- Inherits:
-
Object
- Object
- RStyx::Keyring::Authinfo
- Defined in:
- lib/rstyx/keyring.rb
Overview
Inferno authentication information data
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Diffie-Hellman alpha (generator of Z_p).
-
#cert ⇒ Object
Signature of my public key.
-
#mypk ⇒ Object
My public key.
-
#mysk ⇒ Object
My private (secret) key.
-
#p ⇒ Object
Diffie-Hellman p (prime number).
-
#spk ⇒ Object
Signer’s public key.
Class Method Summary collapse
-
.readauthinfo(fd) ⇒ Object
Read authentication information from an IO instance fd.
Instance Method Summary collapse
-
#initialize(sk, pk, cert, spk, alpha, p) ⇒ Authinfo
constructor
A new instance of Authinfo.
Constructor Details
#initialize(sk, pk, cert, spk, alpha, p) ⇒ Authinfo
Returns a new instance of Authinfo.
416 417 418 419 420 421 422 423 |
# File 'lib/rstyx/keyring.rb', line 416 def initialize(sk, pk, cert, spk, alpha, p) @mysk = sk @mypk = pk @cert = cert @spk = spk @alpha = alpha @p = p end |
Instance Attribute Details
#alpha ⇒ Object
Diffie-Hellman alpha (generator of Z_p)
414 415 416 |
# File 'lib/rstyx/keyring.rb', line 414 def alpha @alpha end |
#cert ⇒ Object
Signature of my public key
405 406 407 |
# File 'lib/rstyx/keyring.rb', line 405 def cert @cert end |
#mypk ⇒ Object
My public key
402 403 404 |
# File 'lib/rstyx/keyring.rb', line 402 def mypk @mypk end |
#mysk ⇒ Object
My private (secret) key
399 400 401 |
# File 'lib/rstyx/keyring.rb', line 399 def mysk @mysk end |
#p ⇒ Object
Diffie-Hellman p (prime number)
411 412 413 |
# File 'lib/rstyx/keyring.rb', line 411 def p @p end |
#spk ⇒ Object
Signer’s public key
408 409 410 |
# File 'lib/rstyx/keyring.rb', line 408 def spk @spk end |
Class Method Details
.readauthinfo(fd) ⇒ Object
Read authentication information from an IO instance fd. This returns an Authinfo instance initialized with the information read from the file.
430 431 432 433 434 435 436 437 |
# File 'lib/rstyx/keyring.rb', line 430 def self.readauthinfo(fd) spk = InfPublicKey.from_s(Keyring.getmsg(fd)) cert = Certificate.from_s(Keyring.getmsg(fd)) mysk = InfPrivateKey.from_s(Keyring.getmsg(fd)) alpha = Keyring.s2big(Keyring.getmsg(fd)) p = Keyring.s2big(Keyring.getmsg(fd)) return(Authinfo.new(mysk, mysk.getpk, cert, spk, alpha, p)) end |