Class: RStyx::Keyring::Authinfo

Inherits:
Object
  • Object
show all
Defined in:
lib/rstyx/keyring.rb

Overview

Inferno authentication information data

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#alphaObject

Diffie-Hellman alpha (generator of Z_p)



414
415
416
# File 'lib/rstyx/keyring.rb', line 414

def alpha
  @alpha
end

#certObject

Signature of my public key



405
406
407
# File 'lib/rstyx/keyring.rb', line 405

def cert
  @cert
end

#mypkObject

My public key



402
403
404
# File 'lib/rstyx/keyring.rb', line 402

def mypk
  @mypk
end

#myskObject

My private (secret) key



399
400
401
# File 'lib/rstyx/keyring.rb', line 399

def mysk
  @mysk
end

#pObject

Diffie-Hellman p (prime number)



411
412
413
# File 'lib/rstyx/keyring.rb', line 411

def p
  @p
end

#spkObject

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