Class: Prevoty::RSAPrivateKey

Inherits:
RSAPublicKey show all
Defined in:
lib/prevoty/responses/rsa_private_key.rb

Instance Attribute Summary collapse

Attributes inherited from RSAPublicKey

#e, #n

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ RSAPrivateKey

Returns a new instance of RSAPrivateKey.



5
6
7
8
9
10
# File 'lib/prevoty/responses/rsa_private_key.rb', line 5

def initialize(data)
  super(data)
  @d = data["D"]
  @primes = data["Primes"]
  @precomputed = data["Precomputed"]
end

Instance Attribute Details

#dObject (readonly)

Returns the value of attribute d.



3
4
5
# File 'lib/prevoty/responses/rsa_private_key.rb', line 3

def d
  @d
end

#precomputedObject (readonly)

Returns the value of attribute precomputed.



3
4
5
# File 'lib/prevoty/responses/rsa_private_key.rb', line 3

def precomputed
  @precomputed
end

#primesObject (readonly)

Returns the value of attribute primes.



3
4
5
# File 'lib/prevoty/responses/rsa_private_key.rb', line 3

def primes
  @primes
end

Instance Method Details

#to_json(*a) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/prevoty/responses/rsa_private_key.rb', line 12

def to_json(*a)
  {
    E: @e,
    N: @n,
    D: @d,
    Primes: @primes,
    Precomputed: @precomputed
  }.to_json
end