Net-SSLeay

 view release on metacpan or  search on metacpan

lib/Net/SSLeay.pod  view on Meta::CPAN

=over

=item * ASN1_TIME_new

B<COMPATIBILITY:> not available in Net-SSLeay-1.42 and before

    my $time = ASN1_TIME_new();
    # returns: value corresponding to openssl's ASN1_TIME structure

=item * ASN1_TIME_free

B<COMPATIBILITY:> not available in Net-SSLeay-1.42 and before

    ASN1_TIME_free($time);
    # $time - value corresponding to openssl's ASN1_TIME structure

=item * ASN1_TIME_set

B<COMPATIBILITY:> not available in Net-SSLeay-1.42 and before

    ASN1_TIME_set($time, $t);
    # $time - value corresponding to openssl's ASN1_TIME structure
    # $t - time value in seconds since 1.1.1970

B<BEWARE:> It is platform dependent how this function will handle dates after 2038.
Although perl's integer is large enough the internal implementation of this function
is dependent on the size of time_t structure (32bit time_t has problem with 2038).

If you want to safely set date and time after 2038 use function L</P_ASN1_TIME_set_isotime>.

=item * P_ASN1_TIME_get_isotime

B<COMPATIBILITY:> not available in Net-SSLeay-1.42 and before

B<NOTE:> Does not exactly correspond to any low level API function

Gives ISO-8601 string representation of ASN1_TIME structure.

    my $datetime_string = P_ASN1_TIME_get_isotime($time);
    # $time - value corresponding to openssl's ASN1_TIME structure
    #
    # returns: datetime string like '2033-05-16T20:39:37Z' or '' on failure

The output format is compatible with module L<DateTime::Format::RFC3339>

=item * P_ASN1_TIME_set_isotime

B<COMPATIBILITY:> not available in Net-SSLeay-1.42 and before

B<NOTE:> Does not exactly correspond to any low level API function

Sets time and date value of ANS1_time structure.

    my $rv = P_ASN1_TIME_set_isotime($time, $string);
    # $time - value corresponding to openssl's ASN1_TIME structure
    # $string - ISO-8601 timedate string like '2033-05-16T20:39:37Z'
    #
    # returns: 1 on success, 0 on failure

The C<$string> parameter has to be in full form like C<"2012-03-22T23:55:33"> or
C<"2012-03-22T23:55:33Z"> or C<"2012-03-22T23:55:33CET">. Short forms like
C<"2012-03-22T23:55"> or C<"2012-03-22"> are not supported.

=item * P_ASN1_TIME_put2string

B<COMPATIBILITY:> not available in Net-SSLeay-1.42 and before, has bugs with OpenSSL 0.9.8i

B<NOTE:> Does not exactly correspond to any low level API function

Gives string representation of ASN1_TIME structure.

    my $str = P_ASN1_TIME_put2string($time);
    # $time - value corresponding to openssl's ASN1_TIME structure
    #
    # returns: datetime string like 'May 16 20:39:37 2033 GMT'

=item * P_ASN1_UTCTIME_put2string

B<NOTE:> deprecated function, only for backward compatibility, just an alias
for L</P_ASN1_TIME_put2string>

=back

=head3 Low level API: X509_* related functions

=over

=item * X509_new

B<COMPATIBILITY:> not available in Net-SSLeay-1.45 and before

Allocates and initializes a X509 structure.

    my $rv = Net::SSLeay::X509_new();
    #
    # returns: value corresponding to openssl's X509 structure (0 on failure)

Check openssl doc L<https://www.openssl.org/docs/manmaster/man3/X509_new.html>

=item * X509_free

Frees up the X509 structure.

    Net::SSLeay::X509_free($a);
    # $a - value corresponding to openssl's X509 structure
    #
    # returns: no return value

Check openssl doc L<https://www.openssl.org/docs/manmaster/man3/X509_new.html>

=item * X509_check_host

B<COMPATIBILITY:> not available in Net-SSLeay-1.68 and before; requires at least OpenSSL 1.0.2. X509_CHECK_FLAG_NEVER_CHECK_SUBJECT requires OpenSSL 1.1.0.

Checks if the certificate Subject Alternative Name (SAN) or Subject CommonName
(CN) matches the specified host name.

    my $rv = Net::SSLeay::X509_check_host($cert, $name, $flags, $peername);
    # $cert - value corresponding to openssl's X509 structure
    # $name - host name to check
    # $flags (optional, default: 0) - can be the bitwise OR of:



( run in 0.840 second using v1.01-cache-2.11-cpan-e1769b4cff6 )