libcrypt-openssl-pkcs12-perl:基于 OpenSSL 的 PKCS12 格式处理 Perl 扩展项目

可用于在 Perl 中处理 PKCS12 格式文件,实现证书与私钥的存储、提取及管理。核心功能包括创建、解析 PKCS12 对象,提取证书和私钥,验证 MAC 及修改密码,依赖 OpenSSL 1.X.X 实现加密操作。【此简介由AI生成】

Branch4Tags3

NAME

Crypt::OpenSSL::PKCS12 - Perl extension to OpenSSL's PKCS12 API.

SYNOPSIS

use Crypt::OpenSSL::PKCS12;

my $pass   = "your password";
my $pkcs12 = Crypt::OpenSSL::PKCS12->new_from_file('cert.p12');

print $pkcs12->certificate($pass);
print $pkcs12->private_key($pass);

if ($pkcs12->mac_ok($pass)) {
...

# Creating a file
$pkcs12->create('test-cert.pem', 'test-key.pem', $pass, 'out.p12', 'friendly name');


# Creating a string
my $pksc12_data = $pkcs12->create_as_string('test-cert.pem', 'test-key.pem', $pass, 'friendly name');

VERSION

This documentation describes version 1.9

DESCRIPTION

PKCS12 is a file format for storing cryptography objects as a single file or string. PKCS12 is commonly used to bundle a private key with its X.509 certificate or to bundle all the members of a chain of trust.

This distribution implements a subset of OpenSSL's PKCS12 API.

SUBROUTINES/METHODS

  • new( )

  • new_from_string( $string )

  • new_from_file( $filename )

    Create a new Crypt::OpenSSL::PKCS12 instance.

  • certificate( [$pass] )

    Get the Base64 representation of the certificate.

  • private_key( [$pass] )

    Get the Base64 representation of the private key.

  • as_string( [$pass] )

    Get the binary represenation as a string.

  • mac_ok( [$pass] )

    Verifiy the certificates Message Authentication Code

  • changepass( $old, $new )

    Change a certificate's password.

  • create( $cert, $key, $pass, $output_file, $friendly_name )

    Create a new PKCS12 certificate. $cert & $key may either be strings or filenames.

    $friendly_name is optional.

  • create_as_string( $cert, $key, $pass, $friendly_name )

    Create a new PKCS12 certificate string. $cert & $key may either be strings or filenames.

    $friendly_name is optional.

    Returns a string holding the PKCS12 certicate.

EXPORTS

None by default.

On request:

  • NOKEYS
  • NOCERTS
  • INFO
  • CLCERTS
  • CACERTS

DIAGNOSTICS

No diagnostics are documented at this time

CONFIGURATION AND ENVIRONMENT

No special environment or configuration is required.

DEPENDENCIES

This distribution has the following dependencies

  • An installation of OpenSSL, version 1.X.X
  • Perl 5.8

SEE ALSO

INCOMPATIBILITIES

Currently the library only supports OpenSSL 1.X.X

The library has not been tested with OpenSSL 3.X.X and is not expected to work with this version at this time

BUGS AND LIMITATIONS

Please see the GitHub repository for known issues.

AUTHOR

Current maintainer

  • jonasbn

CONTRIBUTORS

In alphabetical order, contributors, bug reporters and all

  • @mmuehlenhoff
  • @sectokia
  • @SmartCodeMaker
  • Alexandr Ciornii, @chorny
  • Christopher Hoskin, @mans0954
  • Daisuke Murase, @typester
  • Darko Prelec, @dprelec
  • David Steinbrunner, @dsteinbrunner
  • Giuseppe Di Terlizzi, @giterlizzi
  • H.Merijn Brand, @tux
  • Hakim, @osfameron
  • J. Nick Koston, @bdraco
  • James Rouzier, @jrouzierinverse
  • jonasbn. @jonasbn
  • Kelson, @kelson42
  • Lance Wicks, @lancew
  • Leonid Antonenkov
  • Masayuki Matsuki, @songmu
  • Mikołaj Zalewski
  • Shoichi Kaji
  • Slaven Rezić
  • Todd Rinaldo, @toddr

LICENSE AND COPYRIGHT

Copyright 2004-2021 by Dan Sully

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

Introduction

可用于在 Perl 中处理 PKCS12 格式文件,实现证书与私钥的存储、提取及管理。核心功能包括创建、解析 PKCS12 对象,提取证书和私钥,验证 MAC 及修改密码,依赖 OpenSSL 1.X.X 实现加密操作。【此简介由AI生成】

Customize your domain