The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Crypt::HTTP::Signature::Method::RSA - Compute digest using asymmetric keys

PURPOSE

This class uses asymmetric RSA keys to compute a HTTP signature digest. It implements the RSA-SHA{1, 256, 512} algorithms.

ATTRIBUTES

key

Holds the key data. This should be a string that Crypt::OpenSSL::RSA can instantiate into a private or public key.

If the operation is sign(), then this attribute must hold a private key. In other words, the string this attribute holds should start with

  -----BEGIN RSA PRIVATE KEY-----

If the operation is verify(), then this attribute must hold a public key. In other words, the string this attribute holds should start with

  -----BEGIN PUBLIC KEY-----
data

Holds the data to be signed or verified. This is typically the signing_string attribute from Authen::HTTP::Signature. Read-only. Required.

hash

Digest algorithm. Read-only. Required.

METHODS

sign()

Signs data using key.

Returns a base 64 encoded signature.

verify()

This method validates a signature was generated by a specific private key by using the corresponding public key.

Takes a Base64 encoded signature string as input.

Returns a boolean.

SEE ALSO

Authen::HTTP::Signature