Crypt-SMIME
view release on metacpan or search on metacpan
0.32 Wed Apr 15 14:52:28 JST 2026
Applied a series of patches from cpan [...] schmirler.de
(https://rt.cpan.org/Public/Bug/Display.html?id=175921):
- Crypt::SMIME now requires OpenSSL 3.0 or newer.
- Decryption: Handle the new smime-type value "authEnveloped-data"
in isEncrypted().
- Encryption: Add an optional "cipher" argument to encrypt(...),
defaulting to "AES-128-CBC" as before. Pass e.g. "AES-128-GCM" to
encrypt with a modern AEAD cipher.
- Signing: To tell a peer that we support AEAD ciphers we should
advertise them in the SMIMECapabilities signed attribute. As of
OpenSSL 3.5 AES-GCM is not part of the default list. Now we
advertise AES-256-GCM, AES-128-GCM, AES-256-CBC, and AES-128-CBC.
- Checking: Added the new function "getCapabilities(...)" to get
the SMIMECapabilities a peer sent us. Note that SMIMECapabilities
may not only contain ciphers but also hash algorithms.
Applied a patch from cpan [...] schmirler.de
(https://rt.cpan.org/Public/Bug/Display.html?id=175923):
- Added a new method setVerifyFlags($flags) with the flags
Crypt::SMIME::CRL_CHECK and Crypt::SMIME::CRL_CHECK_ALL to enable
checking CRLs.
0.20 Wed Jan 10 14:32:56 JST 2018
- Fix a bug in _getContentType, Patch by unrtstRMSPAM [...]
cpan.org:
https://rt.cpan.org/Public/Bug/Display.html?id=124035
0.19 Fri Dec 2 13:22:27 JST 2016
- Use RFC-5652 CMS functions instead of PKCS#7 ones for better
interoperability, Suggested by Hib Engler <h [...]
killercool.net>. CMS has a backwards compatibility with
PKCS#7 so the change should introduce no compat issues.
- Use AES-128-CBC instead of DES-EDE3-CBC for encryption,
suggested by the same person.
0.18 Thu Oct 13 18:45:53 JST 2016
- Fix compatibility problem with OpenSSL >= 1.1, Reported by
ppisar [...] redhat.com:
https://rt.cpan.org/Public/Bug/Display.html?id=118344
0.17 Tue Jun 21 12:24:18 JST 2016
- New function: setPrivateKeyPkcs12(), Patch by MIK [...]
cpan.org:
SMIME.mlpod view on Meta::CPAN
å
¬ééµã®å°ãªãã¨ãä¸ã¤ãæ±æããã¦ãã(tainted) ãªãã°ãæ¤è¨¼ãããã¡ãã»ã¼ã¸ãæ±æãããã
>>
=item encrypt()
$encrypted_mime = $smime->encrypt($raw_mime);
$encrypted_mime = $smime->encrypt($raw_mime, $cipher);
Encrypt a MIME message and return a S/MIME message. You can pass any
C<$cipher> string your OpenSSL library understands. Default is
"AES-128-CBC".
J<< ja;
æå·åãè¡ã. å©ç¨ãã¦ãã OpenSSL ã®çè§£ãããããªã©ã®ãã㪠C<$cipher>
ã§ãæå®ã§ãã. ããã©ã«ã㯠"AES-128-CBC" ã§ãã.
>>
Any headers except C<Content-*>, C<MIME-*> and C<Subject> will be moved to the
top-level of the MIME message. C<Subject> header will be copied to both of the
plain text part and the top-level for mail clients which can't properly handle
S/MIME messages.
J<< ja;
C<Content-*>, C<MIME-*> åã³ C<Subject> ãé¤ãããããã¯
multipartã®ãããã¬ãã«ã«ã³ãã¼ãããã
C<Subject> ã¯S/MIMEãèªèã§ããªãã¡ã¼ã©ã®ããã«, multipartã®
# suppose that $mime is prepared.
my $result = $this->_signonly($mime);
$result =~ s/\r?\n|\r/\r\n/g;
$result;
}
sub encrypt {
my $this = shift;
my $mime = shift;
# The man page of CMS_encrypt(3) recommends DES-EDE3-CBC
# for interoperability but it can no longer be considered
# to be a safe algorithm. We use AES-128-CBC instead.
my $cipher = shift // "AES-128-CBC";
if(!defined($mime)) {
die __PACKAGE__."#encrypt: ARG[1] is not defined.\n";
} elsif(ref($mime)) {
die __PACKAGE__."#encrypt: ARG[1] is a Ref. [$mime]\n";
}
$this->_moveHeaderAndDo('_encrypt', $mime, $cipher);
}
of the provided public keys are tainted.
=item encrypt()
$encrypted_mime = $smime->encrypt($raw_mime);
$encrypted_mime = $smime->encrypt($raw_mime, $cipher);
Encrypt a MIME message and return a S/MIME message. You can pass any
C<$cipher> string your OpenSSL library understands. Default is
"AES-128-CBC".
Any headers except C<Content-*>, C<MIME-*> and C<Subject> will be moved to the
top-level of the MIME message. C<Subject> header will be copied to both of the
plain text part and the top-level for mail clients which can't properly handle
S/MIME messages.
The resulting message will be tainted if the original MIME message or
at least one public key is tainted.
lib/SMIME.pm view on Meta::CPAN
# suppose that $mime is prepared.
my $result = $this->_signonly($mime);
$result =~ s/\r?\n|\r/\r\n/g;
$result;
}
sub encrypt {
my $this = shift;
my $mime = shift;
# The man page of CMS_encrypt(3) recommends DES-EDE3-CBC
# for interoperability but it can no longer be considered
# to be a safe algorithm. We use AES-128-CBC instead.
my $cipher = shift // "AES-128-CBC";
if(!defined($mime)) {
die __PACKAGE__."#encrypt: ARG[1] is not defined.\n";
} elsif(ref($mime)) {
die __PACKAGE__."#encrypt: ARG[1] is a Ref. [$mime]\n";
}
$this->_moveHeaderAndDo('_encrypt', $mime, $cipher);
}
lib/SMIME.pm view on Meta::CPAN
of the provided public keys are tainted.
=item encrypt()
$encrypted_mime = $smime->encrypt($raw_mime);
$encrypted_mime = $smime->encrypt($raw_mime, $cipher);
Encrypt a MIME message and return a S/MIME message. You can pass any
C<$cipher> string your OpenSSL library understands. Default is
"AES-128-CBC".
Any headers except C<Content-*>, C<MIME-*> and C<Subject> will be moved to the
top-level of the MIME message. C<Subject> header will be copied to both of the
plain text part and the top-level for mail clients which can't properly handle
S/MIME messages.
The resulting message will be tainted if the original MIME message or
at least one public key is tainted.
lib/SMIME/JA.pod view on Meta::CPAN
å
ã® S/MIME ã¡ãã»ã¼ã¸, C<$flags>, æ¤è¨¼æå» (L</setAtTime>), ã¾ãã¯
å
¬ééµã®å°ãªãã¨ãä¸ã¤ãæ±æããã¦ãã(tainted) ãªãã°ãæ¤è¨¼ãããã¡ãã»ã¼ã¸ãæ±æãããã
=item encrypt()
$encrypted_mime = $smime->encrypt($raw_mime);
$encrypted_mime = $smime->encrypt($raw_mime, $cipher);
æå·åãè¡ã. å©ç¨ãã¦ãã OpenSSL ã®çè§£ãããããªã©ã®ãã㪠C<$cipher>
ã§ãæå®ã§ãã. ããã©ã«ã㯠"AES-128-CBC" ã§ãã.
C<Content-*>, C<MIME-*> åã³ C<Subject> ãé¤ãããããã¯
multipartã®ãããã¬ãã«ã«ã³ãã¼ãããã
C<Subject> ã¯S/MIMEãèªèã§ããªãã¡ã¼ã©ã®ããã«, multipartã®
ãããã¬ãã«ã¨ä¿è·ãããã¡ãã»ã¼ã¸ã®ä¸¡å´ã«é
ç½®ãããã
å
ã® MIME ã¡ãã»ã¼ã¸ãã¾ãã¯å
¬ééµã®å°ãªãã¨ãä¸ã¤ãæ±æããã¦ãã
(tainted) ãªãã°ãæå·åãããã¡ãã»ã¼ã¸ãæ±æãããã
=item decrypt()
( run in 1.077 second using v1.01-cache-2.11-cpan-e1769b4cff6 )