class RSA::Key
An RSA
public or private key.
Refer to PKCS #1 v2.1, section 3, pp. 6-8.
@see www.rsa.com/rsalabs/node.asp?id=2125 @see en.wikipedia.org/wiki/Public-key_cryptography
Attributes
The RSA
public or private exponent, a positive integer.
@return [Integer]
The RSA
public or private exponent, a positive integer.
@return [Integer]
The RSA
public or private exponent, a positive integer.
@return [Integer]
The RSA
modulus, a positive integer.
@return [Integer]
The RSA
modulus, a positive integer.
@return [Integer]
Public Class Methods
Initializes a new key.
@param [Integer, to_i] modulus @param [Integer, to_i] exponent @param [Hash{Symbol => Object}] options
# File lib/rsa-g/key.rb, line 31 def initialize(modulus, exponent, options = {}) @modulus = modulus.to_i @exponent = exponent.to_i @options = options.dup end
Public Instance Methods
Returns a two-element array containing the modulus and exponent.
@return [Array]
# File lib/rsa-g/key.rb, line 50 def to_a [modulus, exponent] end
Returns `true` if this is a valid RSA
key according to {RSA::PKCS1 PKCS #1}.
@return [Boolean]
# File lib/rsa-g/key.rb, line 42 def valid? true # TODO: PKCS #1 v2.1, sections 3.1 and 3.2, pp. 6-7. end