我试图将使用pkcs8编码和加密的私钥转换为PEM,使用模块Convert::PEM并且它要求ASN序列(我相信用于加密的算法是EDE_EDE3 )
我发现此文档: Public-Key Cryptography Standards (PKCS) #8:描述了所使用的语法,但我无法在PERL代码中成功应用,我已尝试过:
my $pem = Convert::PEM->new(
Name => "RSA PRIVATE KEY",
ASN => qq(
PrivateKeyInfo ::= SEQUENCE {
version Version,
privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
privateKey PrivateKey,
attributes [0] IMPLICIT Attributes OPTIONAL }
Version ::= INTEGER
PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
PrivateKey ::= OCTET STRING
Attributes ::= SET OF Attribute
}
))or die "New failed: ", Convert::PEM->errstr;
我做错了什么?