Crypt-SMIME

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


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.

Changes  view on Meta::CPAN

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の

SMIME.pl  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);
}

SMIME.pod  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.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 0.784 second using v1.01-cache-2.11-cpan-e1769b4cff6 )