class OpenSSL::RSA::KeyPair

Defined in:

core/openssl.cr

Constant Summary

LOCK = Mutex.new
PADDING_SIZE = 42

Constructors

Macro Summary

Instance Method Summary

Constructor Detail

def self.generate(bits = 2048, public_exponent = LibCrypto::RSA_F4) : self #

def self.new(rsa : Pointer(LibCrypto::RSA)) #

def self.new(public_key : IO | Nil = nil, private_key : IO | Nil = nil) #

def self.new(public_key : String | Nil = nil, private_key : String | Nil = nil) #

Macro Detail

macro define_decrypt(key, padding) #

macro define_encrypt(key, padding) #

macro handle_error #

Instance Method Detail

def bytesize #

def finalize #

def private_decrypt(string : String) : String #

def private_decrypt(bytes : Bytes) : Bytes #

def private_encrypt(string : String) : String #

def private_encrypt(bytes : Bytes) : Bytes #

def private_key_pem : String #

def public_decrypt(string : String) : String #

def public_decrypt(bytes : Bytes) : Bytes #

def public_encrypt(string : String) : String #

def public_encrypt(bytes : Bytes) : Bytes #

def public_key_pem : String #

def sign(string : String, signature_type = Signature::SHA256) : String #

def sign(bytes : Bytes, signature_type = Signature::SHA256) : Bytes #

def verify?(signed : String, original : String) : Bool #

def verify?(signed : Bytes, original : Bytes, signature_type = Signature::SHA256) : Bool #