rfc2312.S MIME Version 2 Certificate Handling
- 格式:pdf
- 大小:25.41 KB
- 文档页数:20
下面举几个MIME邮件的例子,让我们先对MIME编码的格式有个直观的印象。
例1是最简单的,只带纯文本正文,基本上就是RFC822格式;例2复杂一些,包含纯文本和超文本正文;例3是最复杂的,包含纯文本正文、超文本正文、内嵌资源和文件附件。
其中,行号和行号后的空格是为了分析方便而另外加的,“............”表示此处省略了大段编码。
例11Date:Thu,18Apr200209:32:45+08002From:3To:4Subject:Test5Mime-Version:1.06Content-Type:text/plain;charset="iso-8859-1"78Thisisasimplemail.9例21From:"bhw98"2Reply-To:bhw98@3To:4Subject:Re:help5X-Mailer:Foxmail4.2[cn]6Mime-Version:1.07Content-Type:multipart/alternative;8boundary="=====002_Dragon307572345230_====="91011Thisisamulti-partmessageinMIMEformat.1213--=====002_Dragon307572345230_=====14Content-Type:text/plain;charset="GB2312"15Content-Transfer-Encoding:quoted-printable1617bluesky7810=A3=AC=C4=FA=BA=C3=A3=A11819=A1=A1=A1=A1=D4=DA=CF=C2=C6=AA=D7=EE=BA=F3=BF=C9=D2=D4=CF=C2=D4=D8=B0=A1 =A3=AC=C4=E3............30=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A 12003-04-073132--=====002_Dragon307572345230_=====33Content-Type:text/html;charset="GB2312"34Content-Transfer-Encoding:quoted-printable35363738<METAcontent=3D"text/html;charset=3Dgb2312"=39http-equiv=3DContent-Type>40............798081--=====002_Dragon307572345230_=====--82例31Return-Path:2Delivered-To:bhw98@3Received:(Qmail75513invokedbyalias);20May200202:19:53-00004Received:fromunknown(helobluesky)(61.155.118.135)5by202.106.187.143withSMTP;20May200202:19:53-00006Message-ID:7From:"=?gb2312?B?wLbAtrXEzOwNCg==?="8To:"bhw98"9Cc:10Subject:=?gb2312?B?ztK1xLbgtK6/2rPM0PI=?=11Date:Sat,20May200210:03:36+080012MIME-Version:1.013Content-Type:multipart/mixed;14boundary="----=_NextPart_000_007A_01C3115F.80DFC5E0"15X-Priority:316X-MSMail-Priority:Normal17X-Mailer:MicrosoftOutlookExpress5.00.2919.670018X-MimeOLE:ProducedByMicrosoftMimeOLEV5.00.2919.67001920Thisisamulti-partmessageinMIMEformat.2122------=_NextPart_000_007A_01C3115F.80DFC5E023Content-Type:multipart/related;type="multipart/alternative";24boundary="----=_NextPart_001_007B_01C3115F.80DFC5E0"252627------=_NextPart_001_007B_01C3115F.80DFC5E028Content-Type:multipart/alternative;29boundary="----=_NextPart_002_007C_01C3115F.80DFC5E0"3031------=_NextPart_002_007C_01C3115F.80DFC5E032Content-Type:text/plain;charset="gb2312"33Content-Transfer-Encoding:quoted-printable3435bhw98,=C4=E3=BA=C3!36=D5=E2=CA=C7=CE=D2=D0=B4=B5=C4=B6=E0=B4=AE=BF=DA=CD=A8=D0=C5=B5=C4=B3=CC =D0=37=F2,=C7=EB=D6=B8=BD=CC!383940------=_NextPart_002_007C_01C3115F.80DFC5E041Content-Type:text/html;charset="gb2312"42Content-Transfer-Encoding:quoted-printable43444546html;charset=3Dgb2312"http-equiv=3DContent-Type>475253<BODYbackground=3Dcid:007901c3111c$72b978a0$0100007f@bluesky=54BGCOLOR=3D#ffffff>5556bhw98,=C4=E3=BA=C3!57=D5=E2=CA=C7=CE=D2=D0=B4=B5=C4=B6=E0=B4=AE=BF=DA=CD=A8=D0=C5=B5=C4=B3= CC=58=D0=F2,=C7=EB=D6=B8=BD=CC!596061------=_NextPart_002_007C_01C3115F.80DFC5E0--6263------=_NextPart_001_007B_01C3115F.80DFC5E064Content-Type:image/jpeg;name="=?gb2312?B?x+fAyrGzvrAuSlBH?="65Content-Transfer-Encoding:base6466Content-ID:6768/9j/4AAQSkZJRgABAgEASABIAAD/7QVoUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAA AEA69AQBIAAAAAQABOEJJTQPzAAAAAAAIAAAAAAAAAAA4QklNBAoAAAAAAAEAADhCSU0nEAAAAA AACgAB70AAAAAAAAAAI4QklNA/UAAAAAAEgAL2ZmAAEAbGZmAAYAAAAAAAEAL2ZmAAEAoZmaAAYAA AAAAAEA............169RxVw98Vawq12xQ44q0cKtHFDWKGsKt4EtiuKt4q//9k=170171------=_NextPart_001_007B_01C3115F.80DFC5E0--172173------=_NextPart_000_007A_01C3115F.80DFC5E0174Content-Type:application/msword;name="readme.doc"175Content-Transfer-Encoding:base64176Content-Disposition:attachment;filename="readme.doc"1771780M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAJgA AAAAAAAAA179EAAAKAAAAAEAAAD+////AAAAACUAAAD/////////////////////////////////////////////180////////////////////////////////////////////////////////////////////////////............1688AAAAAAAAAAAAAAAAAAA=16891690------=_NextPart_000_007A_01C3115F.80DFC5E01691Content-Type:application/x-zip-compressed;1692name="=?gb2312?B?tuC0rr/azajQxbXE1LTC6y56aXA=?="1693Content-Transfer-Encoding:base641694Content-Disposition:attachment;1695filename="=?gb2312?B?tuC0rr/azajQxbXE1LTC6y56aXA=?="16961697UEsDBBQAAAAIAFKAoi7qOMOvLw0AAABWAAAUAAAAtuC0rr/azajQxbXE1LTC6y5kb2PtXHtwV NUZ1698/+4+kk3IQoAkBkRYQkSgbrKb7IYNEMwmm6ckG0jCI0boZneTbJJ9sNlAEsdOtFqd8Z846tQ6PhB1 1699hrZTJoK0Vhgf1aGt4rMy6D8tdugfTjuOpcBIR9j+vvsIy4YkRNTRen87v/ud53cee+6557vn7L73 ............3125zajQxbXE1LTC6y5kb2NQSwUGAAAAAAEAAQBCAAAAYQ0AAA==31263127------=_NextPart_000_007A_01C3115F.80DFC5E0--3128Q在开始研究MIME邮件的时候,如何得到这样的源码?A一些功能比较完善的邮件客户端软件,如微软的OutlookExpress,国产的Foxmail等,都提供了查看和保存邮件源码(原始信息)的功能。
SDP: Session Description Protocol(会话描述协议)(RFC2327)1.概述SDP也是MMUSIC工作组的一个产品,在MBONE内容中用得很多。
其目的就是在媒体会话中,传递媒体流信息,允许会话描述的接收者去参与会话。
SDP基本上在internet上工作。
他定义了绘画描述的统一格式,但并不定义多播地址的分配和SDP消息的传输,也不支持媒体编码方案的协商,这些功能均由下层传送协议完成.典型的会话传送协议包括:SAP(Session Announcement Protocol 会话公告协议),SIP,RTSP,HTTP,和使用MIME的E-Mail.(注意:对SAP只能包含一个会话描述,其它会话传诵协议的SDP可包含多个绘画描述) SDP包括以下一些方面:1)会话的名称和目的2)会话存活时间3)包含在会话中的媒体信息,包括:媒体类型(video, audio, etc)传输协议(RTP/UDP/IP, H.320, etc)媒体格式(H.261 video, MPEG video, etc)多播或远端(单播)地址和端口4)为接收媒体而需的信息(addresses, ports, formats and so on)5)使用的带宽信息6)可信赖的接洽信息(Contact information)2.协议Session description //格式及举例v= (protocol version) //v=0o= (owner/creator and session identifier). //o=<用户名><会话id><版本><网络类//型><地址类型><地址>//o=sname 1234567890 0987654321 IN//IP4 126.15.64.3s= (session name) //会话名i=* (session information) //会话信息u=* (URI of description) //u=/staff/sdp.pse=* (email address) //e=zte@(general text如:王生)//或e=Mr. Wang<wang@> p=* (phone number) //p=+86-0755-********-7110(wang)//or p=+1 617 253 6011c=* (connection information -如已经包含在所有媒体中则该行不需要)//c=<网络类型><地址信息><连接地址>//多点会议包括TTL//连接地址: <base multicast//address>/<ttl>/<number of addresses>//c=IN IP4 224.2.13.23/127//c=IN IP4 224.2.1.1/127/3b=* (bandwidth information) //b=<修改量(CT Conference Total//IAS Application-specific Max)>:<带宽//值(kb/s)>//b=CT:120One or more time descriptions (see below)z=* (time zone adjustments) //时区调整k=* (encryption key) //k=<方法>:<密钥>或k=<方法>a=* (zero or more session attribute lines) //a=<属性> 或a=<属性>:<值>Zero or more media descriptions (see below)各行严格按顺序,其中:时间描述:t= (time the session is active) //<开始时间><结束时间>,单位秒,十//进制NTP//t=2873397468 2873404969 r=* (zero or more repeat times) //<重复时间><活动持续时间//以开始时刻为参考的偏移列表>单位秒//r=604800 3666 90000 或写成//r=7d 1h 0 25h媒体描述:m= (media name and transport address) //m=<媒体><端口><传送><格式列表>//m=audio 49170 RTP/A VP 0 3//协议为RTP,剖面为A VP//参考rtp-parameters.txti=* (media title媒体称呼) //c=* (connection information –如已经包含在会话级描述则为可选)b=* (bandwidth information) //同ck=* (encryption key) //会话级为摸认值,同ca=* (zero or more media attribute lines) //两种形式:(也同c)(见后说明)//a=<attribute>如:// a=recvonly//a=<attribute>:<value>注:v,o,s,t,m为必须的,其他项为可选。
了解 S/MIME主题上次修改时间: 2006-08-16在 S/MIME 之前,管理员使用被广泛接受的电子邮件协议 – 简单邮件传输协议 (SMTP),该协议由于其内在的原因而缺乏安全性;或者使用更安全但专用的解决方案。
管理员选择解决方案时或者着眼于安全性,或者着眼于连接性。
由于使用 S/MIME ,管理员现在可选择使用既安全又被广泛接受的电子邮件。
S/MIME 是与 SMTP 同样重要的一个标准,因为它将 SMTP 带入了一个新的层次:既能实现广泛的电子邮件连接性,又不会破坏安全性。
S/MIME 的历史了解 S/MIME 的功能了解数字签名©2010 Microsoft Corporation. All rights reserved.要了解 S/MIME ,了解它的发展历史会对您有所帮助。
第一版 S/MIME 是由许多安全供应商于 1995 年开发出来的。
它是实现邮件安全性的几个规范之一。
例如,Pretty Good Privacy (PGP) 是实现邮件安全性的另一个规范。
在 S/MIME 版本 1 推出时,安全邮件并没有公认的单一标准,但有几个相互竞争的标准。
1998 年,随着 S/MIME 2 的推出,情况开始发生变化。
与版本 1 不同的是,出于希望成为 Internet 标准的考虑,S/MIME 2 被提交到 Internet 工程任务组 (IETF)。
通过这一步,S/MIME 从许多可能的标准中脱颖而出,从而成为邮件安全标准的领跑者。
S/MIME 2 由两份 IETF 征求意见文档 (RFC) 组成:建立邮件标准的 RFC 2311(/rfc/rfc2311.txt [ /rfc/rfc2311.txt ] ) 和建立证书处理标准的 RFC 2312 (/rfc/rfc2312.txt [ /rfc/rfc2312.txt ] )。
这两份 RFC 共同提供了第一个基于 Internet 标准的框架,供应商可以按照该框架来提出可互操作的邮件安全解决方案。
⽹络安全服务(NetworkSecurityServices,NSS⽹络安全服务(Network Security Services, NSS)是⼀套为⽹络安全服务⽽设计的库⽀持⽀持安全的客户端和服务器应⽤程序。
使⽤NSS构建的应⽤程序可以⽀持SSL v2和v3, TLS, PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509v3证书和其他安全标准。
如果需要命令⾏⼯具,请安装nss-tools包操作NSS证书和密钥数据库。
开源加密库经过验证的应⽤程序安全体系结构如果您想为您的应⽤程序添加对SSL、S/MIME或其他互联⽹安全标准的⽀持,您可以使⽤⽹络安全服务(NSS)来实现所有的安全特性。
NSS提供了AOL、Red Hat、⾕歌和其他公司在各种产品中使⽤的加密库的完整开源实现,包括以下内容:Mozilla产品,包括Firefox、Thunderbird、SeaMonkey和Firefox OS。
美国在线即时通讯(AIM)开源客户端应⽤程序,如Evolution、Pidgin、Apache OpenOffice和LibreOffice。
Red Hat的服务器产品包括:Red Hat Directory Server、Red Hat Certificate System和Apache web服务器的mod_nss SSL模块。
Oracle(原Sun Java企业系统)的服务器产品,包括Oracle通信消息传递服务器和Oracle⽬录服务器企业版。
SUSE Linux Enterprise Server⽀持NSS, Apache web服务器⽀持mod_nss SSL模块。
NSS包括⼀个框架,开发⼈员和原始设备制造商可以提供补丁,如汇编代码,以优化其平台上的性能。
NSS 3。
x已经在18个平台上获得了认证。
有关NSS的更多详细信息,请参阅和NSS FAQ。
安全电子邮件系统的设计与实现Secure E-mail System Design and Implementation摘要:电子邮件的安全问题是目前实际网络应用中被广泛关注的热点问题之一。
文章分析了当前电子邮件在安全方面的隐患,设计了一种实现内联网端到端的安全电子邮件系统,并详细介绍了安全电子邮件系统中签名加密、轻量目录访问协议(LDAP)证书库、目录等部分的设计思路。
文章还给出了把安全电子邮件系统扩展应用在大企业Intranet中的方案。
关键词:电子邮件;安全;安全/多用途互联网邮件扩充;公钥基础设施;轻量目录访问协议Abstract:Email security is currently one of the hot-spot issues in network applications, drawing broad attention. Based on the analysis of the shortcomings of current email systems, this paper presents an end-to-end secure email system on Intranet, putting emphasis on the design of digital signature encryption, Lightweight Directory Access Protocol (LDAP) certificate server and system directory. At last, it gives solutions of implementing such a system on an enterprise Intranet.Key words:E-mail; security; S/MIME; PKI; LDAP电子邮件利用计算机的存储、转发原理,克服时间、地理上的差距,通过计算机终端和通信网络进行文字、声音、图像等信息的传递。
RFC822:一、简介1977年,Arpnet在他们开发的几个非正式文本消息传送标准的基础上,制订了“Arpnet网络之间文本消息格式标准”,即RFC#733。
后来为了适应更大、更复杂的Arpnet网,对RFC#733作了一些修订,形成了RFC#822。
虽然RFC#822是专门为Arpnet网设计的,但其他网络之间的文本消息传输也可以用二、适用范围只对邮件的头部部分做出了规范,对消息体没有做出任何规范。
三、主要语法规则Field = Field Name + “:” + Field Body + CRLF例如时间 Date: Thu, 18 Jan 2001 14:21:34 +0800 (CST)地址 from: “hetielin”hetl@四、实现分离邮件的字段体和字段体,存贮在线性链表中MIME协议:一、简介MIME(Multipurpose Internet Mail Extensions),RFC#822定义了消息头的传输标准,而把消息体当成纯ASCII文本。
这个文档重新定义了消息体的格式,使得消息体可以在交换非文本信息时不会失真。
同时也使得消息可以在RFC#822主机和X.400主机(认为在消息体中加入非文本信息是合法的)之间进行交换。
二、消息头格式扩展主要是为了解决如下三种情况(1)在参数值当中使用非ASCII字符(2)明确需要显示参数指示所用的语言(3)参数值过长的问题例子一Content-Type: message/external-body; access-type=URL;URL*0="ftp://";URL*1="/pub/moore/bulk-mailer/bulk-mailer.tar"在语义上等价于Content-Type: message/external-body; access-type=URL;URL="ftp:///pub/moore/bulk-mailer/bulk-mailer.tar"其中*后面加一个正整数表示用多行代表一个参数值例子二Content-Type: application/x-stuff;title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A参数名后面紧跟*表示后面有字符集(character set)和语言(language)信息,参数值当中单引号(')表示前面是字符信息或者语言信息,百分号(%)表示后面跟的是一个用十六进制编码的字符。
某某石油管理局企业标准应用平台安全技术标准1适用范围某某油田各单位通用2规范解释权本规定适用于某某油田管理局信息安全管理中心和下属各单位中心机房。
3应用平台安全概述应用平台指建立在网络系统之上的应用软件服务,如数据库服务器、电子邮件服务器、Web服务器等。
由于应用平台的系统非常复杂,通常采用多种技术(如SSL等)来增强应用平台的安全性。
现结合油田系统的应用分别阐述。
4应用平台安全数据库的安全4.1.1 数据库安全概述数据库是按照某种规则主旨的存储数据的集合,换句话说,数据库是由信息实体和这些实体之间的关系组成的,这些关系和实体在数据库内以某种物理的方式(指针或记录)表示,数据库管理系统为用户和其他应用程序提供对数据库的访问,同时也提供事件登录,恢复和数据库组织。
数据库的基本特性是它支持若干不同的应用(即可批处理也可联机处理等)以满足各种用户的数据要求。
对于数据库系统来说,威胁主要来自:非法访问数据库信息;恶意破坏数据库或未经授权非法修改数据库数据;用户经过网络进行数据库访问时,受到各种攻击,如搭线窃听等;对数据库的不正确访问,引起数据库数据的错误。
要对抗这些威胁,仅仅采用操作系统和网络中的保护是不够的,因为它的结构与其它系统不同,含有重要程度和敏感级别不同的各种数据,并未拥有各种特权的用户共享,同时又不能超出给定的范围。
它涉及的范围很广,除了对计算机,外部设备,联机网络和通信设备进行物理保护外,还要采用软件保护技术,防止非法运行系统软件,应用程序和用户专用软件;采取访问控制和加密,防止非法访问或盗用机密数据;对非法访问的记录和跟踪,同时要保证数据的完整性和一致性。
4.1.2 标准细则1.实现数据完整性,保证数据库中数据的正确,有效,使其免受无效更新的影响。
2.防止外部非法程序或是外部力量(如火灾火或电)篡改或干扰数据,使得整个数据库被破坏(例如,发生磁盘密封损坏或其他损坏)或单个数据项不可读。
3.应能定期备份系统中的所有文件,以防止灾难性故障4.能使用单向函数的密码算法对数据加密,以确保数据的完整性。
MIME协议文档说明书RFC#1521协议简介RFC#822定义了消息头的传输标准,而把消息体当成纯ASCII文本。
这个文档重新定义了消息体的格式,使得消息体在交换非文本信息时不会失真。
同时也使得消息可以在RFC#822主机和X.400主机(认为在消息体中加入非文本信息是合法的)之间进行交换。
该文档主要描述了MIME-Version字段、Content-Type字段、Content-Transfer-Encoding字段。
另外还简单的介绍了两个额外的字段:Content-ID和Content-DescriptionMIME是可扩展的,它允许通过一定的方式向IANA注册新的字段或对现有字段的取值范围进行扩充。
在对文档进行进一步描述之前,需要先界定如下字段的含义:✧"message",当没有进一步说明,它可以表示一个正在网上传输的完整消息,也可表示封装在一个Content Type值为"message/rfc822"或"message/partial"的"body"里的消息。
✧"body part",表示Content-Type值为"multipart"的消息实体的一部分,它有一个头和一个体。
✧"entity",实体,由MIME定义的头和消息或"body part"中的内容组成。
✧"body",表示"message"或"body part"的体部分。
MIME-Version字段该字段用一个版本号说明了消息所要遵循的规范,以区别不兼容的消息版本。
如,MIME-Version: 1.0表示该消息遵循rfc#1521。
为了便于描述以后扩展的消息格式,我们把MIME-Version字段定义为:version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT;两个被点(".")分开的整数。
Network Working Group S. Dusse Request for Comments: 2312 RSA Data Security Category: Informational P. Hoffman Internet Mail Consortium B. Ramsdell Worldtalk J. Weinstein Netscape March 1998 S/MIME Version 2 Certificate HandlingStatus of this MemoThis memo provides information for the Internet community. It doesnot specify an Internet standard of any kind. Distribution of thismemo is unlimited.Copyright NoticeCopyright (C) The Internet Society (1998). All Rights Reserved.1. OverviewS/MIME (Secure/Multipurpose Internet Mail Extensions), described in[SMIME-MSG], provides a method to send and receive secure MIMEmessages. In order to validate the keys of a message sent to it, anS/MIME agent needs to certify that the key is valid. This memodescribes the mechanisms S/MIME uses to create and validate keysusing certificates.This specification is compatible with PKCS #7 in that it uses thedata types defined by PKCS #7. It also inherits all the varieties of architectures for certificate-based key management supported by PKCS #7. Note that the method S/MIME messages make certificate requestsis defined in [SMIME-MSG].In order to handle S/MIME certificates, an agent has to followspecifications in this memo, as well as some of the specificationslisted in the following documents:- "PKCS #1: RSA Encryption", [PKCS-1].- "PKCS #7: Cryptographic Message Syntax", [PKCS-7]- "PKCS #10: Certification Request Syntax", [PKCS-10].Dusse, et. al. Informational [Page 1]Please note: The information in this document is historical material being published for the public record. It is not an IETF standard.The use of the word "standard" in this document indicates a standard for adopters of S/MIME version 2, not an IETF standard.1.1 DefinitionsFor the purposes of this memo, the following definitions apply.ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208.BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209.Certificate: A type that binds an entity’s distinguished name to apublic key with a digital signature. This type is defined in CCITTX.509 [X.509]. This type also contains the distinguished name of the certificate issuer (the signer), an issuer-specific serial number,the issuer’s signature algorithm identifier, and a validity period.Certificate Revocation List (CRL): A type that contains informationabout certificates whose validity an issuer has prematurely revoked. The information consists of an issuer name, the time of issue, thenext scheduled time of issue, and a list of certificate serialnumbers and their associated revocation times. The CRL is signed bythe issuer. The type intended by this specification is the onedefined in [KEYM].DER: Distinguished Encoding Rules for ASN.1, as defined in CCITTX.509.1.2 Compatibility with Prior Practice of S/MIMEAppendix C contains important information about how S/MIME agentsfollowing this specification should act in order to have the greatest interoperability with earlier implementations of S/MIME.1.3 TerminologyThroughout this memo, the terms MUST, MUST NOT, SHOULD, and SHOULDNOT are used in capital letters. This conforms to the definitions in [MUSTSHOULD]. [MUSTSHOULD] defines the use of these key words tohelp make the intent of standards track documents as clear aspossible. The same key words are used in this document to helpimplementors achieve interoperability.Dusse, et. al. Informational [Page 2]2. PKCS #7 OptionsThe PKCS #7 message format allows for a wide variety of options incontent and algorithm support. This section puts forth a number ofsupport requirements and recommendations in order to achieve a baselevel of interoperability among all S/MIME implementations. Most ofthe PKCS #7 format for S/MIME messages is defined in [SMIME-MSG].2.1 CertificateRevocationListsReceiving agents MUST support for the Certificate Revocation List(CRL) format defined in [KEYM]. If sending agents include CRLs inoutgoing messages, the CRL format defined in [KEYM] MUST be used.All agents MUST validate CRLs and check certificates against CRLs, if available, in accordance with [KEYM]. All agents SHOULD check thenextUpdate field in the CRL against the current time. If the current time is later than the nextUpdate time, the action that the agenttakes is a local decision. For instance, it could warn a human user, it could retrieve a new CRL if able, and so on.Receiving agents MUST recognize CRLs in received S/MIME messages.Clients MUST use revocation information included as a CRL in anS/MIME message when verifying the signature and certificate pathvalidity in that message. Clients SHOULD store CRLs received inmessages for use in processing later messages.Clients MUST handle multiple valid Certificate Authority (CA)certificates containing the same subject name and the same publickeys but with overlapping validity intervals.2.2 ExtendedCertificateOrCertificateReceiving agents MUST support X.509 v1 and X.509 v3 certificates. See [KEYM] for details about the profile for certificate formats. Endentity certificates MUST include an Internet mail address, asdescribed in section 3.1.2.2.1 Historical Note About PKCS #7 CertificatesThe PKCS #7 message format supports a choice of certificate twoformats for public key content types: X.509 and PKCS #6 ExtendedCertificates. The PKCS #6 format is not in widespread use. Inaddition, proposed revisions of X.509 certificates address much ofthe same functionality and flexibility as was intended in the PKCS#6. Thus, sending and receiving agents MUST NOT use PKCS #6 extended certificates.Dusse, et. al. Informational [Page 3]2.3 ExtendedCertificateAndCertificatesReceiving agents MUST be able to handle an arbitrary number ofcertificates of arbitrary relationship to the message sender and toeach other in arbitrary order. In many cases, the certificatesincluded in a signed message may represent a chain of certificationfrom the sender to a particular root. There may be, however,situations where the certificates in a signed message may beunrelated and included for convenience.Sending agents SHOULD include any certificates for the user’s public key(s) and associated issuer certificates. This increases thelikelihood that the intended recipient can establish trust in theoriginator’s public key(s). This is especially important whensending a message to recipients that may not have access to thesender’s public key through any other means or when sending a signed message to a new recipient. The inclusion of certificates in outgoing messages can be omitted if S/MIME objects are sent within a group of correspondents that has established access to each other’scertificates by some other means such as a shared directory or manual certificate distribution. Receiving S/MIME agents SHOULD be able tohandle messages without certificates using a database or directorylookup scheme.A sending agent SHOULD include at least one chain of certificates up to, but not including, a Certificate Authority (CA) that it believes that the recipient may trust as authoritative. A receiving agentSHOULD be able to handle an arbitrarily large number of certificates and chains.Clients MAY send CA certificates, that is, certificates that areself-signed and can be considered the "root" of other chains. Notethat receiving agents SHOULD NOT simply trust any self-signedcertificates as valid CAs, but SHOULD use some other mechanism todetermine if this is a CA that should be trusted.Receiving agents MUST support chaining based on the distinguishedname fields. Other methods of building certificate chains may besupported but are not currently recommended.Dusse, et. al. Informational [Page 4]3. Distinguished Names in Certificates3.1 Using Distinguished Names for Internet MailThe format of an X.509 certificate includes fields for the subjectname and issuer name. The subject name identifies the owner of aparticular public key/private key pair while the issuer name is meant to identify the entity that "certified" the subject (that is, whosigned the subject’s certificate). The subject name and issuer nameare defined by X.509 as Distinguished Names.Distinguished Names are defined by a CCITT standard X.501 [X.501]. A Distinguished Name is broken into one or more Relative Distinguished Names. Each Relative Distinguished Name is comprised of one or more Attribute-Value Assertions. Each Attribute-Value Assertion consistsof a Attribute Identifier and its corresponding value information,such as CountryName=US. Distinguished Names were intended to identify entities in the X.500 directory tree [X.500]. Each RelativeDistinguished Name can be thought of as a node in the tree which isdescribed by some collection of Attribute-Value Assertions. Theentire Distinguished Name is some collection of nodes in the treethat traverse a path from the root of the tree to some end node which represents a particular entity.The goal of the directory was to provide an infrastructure touniquely name every communications entity everywhere. However,adoption of a global X.500 directory infrastructure has been slowerthan expected. Consequently, there is no requirement for X.500directory service provision in the S/MIME environment, although such provision would almost undoubtedly be of great value in facilitating key management for S/MIME.The use of Distinguished Names in accordance with the X.500 directory is not very widespread. By contrast, Internet mail addresses, asdescribed in RFC 822 [RFC-822], are used almost exclusively in theInternet environment to identify originators and recipients ofmessages. However, Internet mail addresses bear no resemblance toX.500 Distinguished Names (except, perhaps, that they are bothhierarchical in nature). Some method is needed to map Internet mailaddresses to entities that hold public keys. Some people haveDusse, et. al. Informational [Page 5]suggested that the X.509 certificate format should be abandoned infavor of other binding mechanisms. Instead, S/MIME keeps the X.509certificate and Distinguished Name mechanisms while tailoring thecontent of the naming information to suit the Internet mailenvironment.End-entity certificates MUST contain an Internet mail address asdescribed in [RFC-822]. The address must be an "addr-spec" as defined in Section 6.1 of that specification.Receiving agents MUST recognize email addresses in the subjectAltName field. Receiving agents MUST recognize email addresses in theDistinguished Name field.Sending agents SHOULD make the address in the From header in a mailmessage match an Internet mail address in the signer’s certificate.Receiving agents MUST check that the address in the From header of a mail message matches an Internet mail address in the signer’scertificate. A receiving agent MUST provide some explicit alternateprocessing of the message if this comparison fails, which may be toreject the message.3.2 Required Name AttributesReceiving agents MUST support parsing of zero, one, or more instances of each of the following set of name attributes within theDistinguished Names in certificates.Sending agents MUST include the Internet mail address duringDistinguished Name creation. Guidelines for the inclusion, omission, and ordering of the remaining name attributes during the creation of a distinguished name will most likely be dictated by the policiesassociated with the certification service which will certify thecorresponding name and public key.CountryNameStateOrProvinceNameLocalityCommonNameTitleOrganizationOrganizationalUnitStreetAddressPostalCodePhoneNumberEmailAddressDusse, et. al. Informational [Page 6]All attributes other than EmailAddress are described in X.520[X.520]. EmailAddress is an IA5String that can have multipleattribute values.4. Certificate ProcessingA receiving agent needs to provide some certificate retrievalmechanism in order to gain access to certificates for recipients ofdigital envelopes. There are many ways to implement certificateretrieval mechanisms. X.500 directory service is an excellent example of a certificate retrieval-only mechanism that is compatible withclassic X.500 Distinguished Names. The PKIX Working Group isinvestigating other mechanisms. Another method under consideration by the IETF is to provide certificate retrieval services as part of the existing Domain Name System (DNS). Until such mechanisms are widelyused, their utility may be limited by the small number ofcorrespondent’s certificates that can be retrieved. At a minimum, for initial S/MIME deployment, a user agent could automatically generate a message to an intended recipient requesting that recipient’scertificate in a signed return message.Receiving and sending agents SHOULD also provide a mechanism to allow a user to "store and protect" certificates for correspondents in such a way so as to guarantee their later retrieval. In many environments, it may be desirable to link the certificate retrieval/storagemechanisms together in some sort of certificate database. In itssimplest form, a certificate database would be local to a particular user and would function in a similar way as a "address book" thatstores a user’s frequent correspondents. In this way, the certificate retrieval mechanism would be limited to the certificates that a user has stored (presumably from incoming messages). A comprehensivecertificate retrieval/storage solution may combine two or moremechanisms to allow the greatest flexibility and utility to the user. For instance, a secure Internet mail agent may resort to checking acentralized certificate retrieval mechanism for a certificate if itcan not be found in a user’s local certificate storage/retrievaldatabase.Receiving and sending agents SHOULD provide a mechanism for theimport and export of certificates, using a PKCS #7 certs-onlymessage. This allows for import and export of full certificate chains as opposed to just a single certificate. This is described in[SMIME-MSG].Dusse, et. al. Informational [Page 7]4.1 Certificate Revocation ListsA receiving agent SHOULD have access to some certificate-revocationlist (CRL) retrieval mechanism in order to gain access tocertificate-revocation information when validating certificatechains. A receiving or sending agent SHOULD also provide a mechanism to allow a user to store incoming certificate-revocation information for correspondents in such a way so as to guarantee its laterretrieval. However, it is always better to get the latest information from the CA than to get information stored away from incomingmessages.Receiving and sending agents SHOULD retrieve and utilize CRLinformation every time a certificate is verified as part of acertificate chain validation even if the certificate was alreadyverified in the past. However, in many instances (such as off-lineverification) access to the latest CRL information may be difficultor impossible. The use of CRL information, therefore, may be dictated by the value of the information that is protected. The value of theCRL information in a particular context is beyond the scope of thismemo but may be governed by the policies associated with particularcertificate hierarchies.4.2 Certificate Chain ValidationIn creating a user agent for secure messaging, certificate, CRL, and certificate chain validation SHOULD be highly automated while stillacting in the best interests of the user. Certificate, CRL, and chain validation MUST be performed when validating a correspondent’s public key. This is necessary when a) verifying a signature from acorrespondent and, b) creating a digital envelope with thecorrespondent as the intended recipient.Certificates and CRLs are made available to the chain validationprocedure in two ways: a) incoming messages, and b) certificate andCRL retrieval mechanisms. Certificates and CRLs in incoming messages are not required to be in any particular order nor are they required to be in any way related to the sender or recipient of the message(although in most cases they will be related to the sender). Incoming certificates and CRLs SHOULD be cached for use in chain validationand optionally stored for later use. This temporary certificate andCRL cache SHOULD be used to augment any other certificate and CRLretrieval mechanisms for chain validation on incoming signedmessages.Dusse, et. al. Informational [Page 8]4.3 Certificate and CRL Signing AlgorithmsCertificates and Certificate-Revocation Lists (CRLs) are signed bythe certificate issuer. A receiving agent MUST be capable ofverifying the signatures on certificates andCRLs made withmd5WithRSAEncryption and sha-1WithRSAEncryption signature algorithms with key sizes from 512 bits to 2048 bits described in [SMIME-MSG]. A receiving agent SHOULD be capable of verifying the signatures oncertificates and CRLs made with the md2WithRSAEncryption signaturealgorithm with key sizes from 512 bits to 2048 bits.4.4 X.509 Version 3 Certificate ExtensionsThe X.509 v3 standard describes an extensible framework in which the basic certificate information can be extended and how such extensions can be used to control the process of issuing and validatingcertificates. The PKIX Working Group has ongoing efforts to identify and create extensions which have value in particular certificationenvironments. As such, there is still a fair amount of profiling work to be done before there is widespread agreement on which v3extensions will be used. Further, there are active efforts underwayto issue X.509 v3 certificates for business purposes. This memoidentifies the minumum required set of certificate extensions whichhave the greatest value in the S/MIME environment. ThebasicConstraints, and keyUsage extensions are defined in [X.509].Sending and receiving agents MUST correctly handle the v3 BasicConstraints Certificate Extension, the Key Usage CertificateExtension, authorityKeyID, subjectKeyID, and the subjectAltNames when they appear in end-user certificates. Some mechanism SHOULD exist to handle the defined v3 certificate extensions when they appear inintermediate or CA certificates.Certificates issued for the S/MIME environment SHOULD NOT contain any critical extensions other than those listed here. These extensionsSHOULD be marked as non-critical unless the proper handling of theextension is deemed critical to the correct interpretation of theassociated certificate. Other extensions may be included, but thoseextensions SHOULD NOT be marked as critical.4.4.1 Basic Constraints Certificate ExtensionThe basic constraints extension serves to delimit the role andposition of an issuing authority or end-user certificate plays in achain of certificates.Dusse, et. al. Informational [Page 9]For example, certificates issued to CAs and subordinate CAs contain a basic constraint extension that identifies them as issuing authority certificates. End-user subscriber certificates contain an extensionthat constrains the certificate from being an issuing authoritycertificate.Certificates SHOULD contain a basicContstraints extension.4.4.2 Key Usage Certificate ExtensionThe key usage extension serves to limit the technical purposes forwhich a public key listed in a valid certificate may be used. Issuing authority certificates may contain a key usage extension thatrestricts the key to signing certificates, certificate revocationlists and other data.For example, a certification authority may create subordinate issuer certificates which contain a keyUsage extension which specifies that the corresponding public key can be used to sign end user certs andsign CRLs.5. Generating Keys and Certification Requests5.1 Binding Names and KeysAn S/MIME agent or some related administrative utility or functionMUST be capable of generating a certification request given a user’s public key and associated name information. In most cases, the user’s public key/private key pair will be generated simultaneously.However, there are cases where the keying information may begenerated by an external process (such as when a key pair isgenerated on a cryptographic token or by a "key recovery" service).There SHOULD NOT be multiple valid (that is, non-expired and non-revoked) certificates for the same key pair bound to differentDistinguished Names. Otherwise, a security flaw exists where anattacker can substitute one valid certificate for another in such away that can not be detected by a message recipient. If a userswishes to change their name (or create an alternate name), the useragent SHOULD generate a new key pair. If the user wishes to reuse an existing key pair with a new or alternate name, the user SHOULD first have any valid certificates for the existing public key revoked.In general, it is possible for a user to request certification forthe same name and different public key from the same or differentcertification authorities. This is acceptable both for end-entityand issuer certificates and can be useful in supporting a change ofissuer keys in a smooth fashion.Dusse, et. al. Informational [Page 10]CAs that re-use their own name with distinct keys MUST include theAuthorityKeyIdentifier extension in certificates that they issue, and MUST have the SubjectKeyIdentifier extension in their owncertificate. CAs SHOULD use these extensions uniformly.Clients SHOULD handle multiple valid CA certificates that certifydifferent public keys but contain the same subject name (in thiscase, that CA’s name).When selecting an appropriate issuer’s certificate to use to verify a given certificate, clients SHOULD process the AuthorityKeyIdentifier and SubjectKeyIdentifier extensions.5.2 Using PKCS #10 for Certification RequestsPKCS #10 is a flexible and extensible message format for representing the results of cryptographic operations on some data. The choice ofnaming information is largely dictated by the policies and procedures associated with the intended certification service.In addition to key and naming information, the PKCS #10 formatsupports the inclusion of optional attributes, signed by the entityrequesting certification. This allows for information to be conveyed in a certification request which may be useful to the requestprocess, but not necessarily part of the Distinguished Name beingcertified.Receiving agents MUST support the identification of an RSA key withthe rsa defined in X.509 and the rsaEncryption OID. Certificationauthorities MUST support sha-1WithRSAEncryption andmd5WithRSAEncryption and SHOULD support MD2WithRSAEncryption forverification of signatures on certificate requests as described in[SMIME-MSG].For the creation and submission of certification-requests, RSA keysSHOULD be identified with the rsaEncryption OID and signed with thesha-1WithRSAEncryption signature algorithm. Certification-requestsMUST NOT be signed with the md2WithRSAEncryption signature algorithm. Certification requests MUST include a valid Internet mail address,either as part of the certificate (as described in 3.2) or as part of the PKCS #10 attribute list. Certification authorities MUST checkthat the address in the "From:" header matches either of theseaddresses. CAs SHOULD allow the CA operator to configure processingof messages whose addresses do not match.Dusse, et. al. Informational [Page 11]Certification authorities SHOULD support parsing of zero or oneinstance of each of the following set of certification-requestattributes on incoming messages. Attributes that a particularimplementation does not support may generate a warning message to the requestor, or may be silently ignored. Inclusion of the followingattributes during the creation and submission of a certification-request will most likely be dictated by the policies associated with the certification service which will certify the corresponding nameand public key.postalAddresschallengePasswordunstructuredAddresspostalAddress is described in [X.520].5.2.1 Challenge PasswordThe challenge-password attribute type specifies a password by whichan entity may request certificate revocation. The interpretation ofthe password is intended to be specified by the issuer of thecertificate; no particular interpretation is required. Thechallenge-password attribute type is intended for PKCS #10certification requests.Challenge-password attribute values have ASN.1 type ChallengePassword: ChallengePassword ::= CHOICE {PrintableString, T61String }A challenge-password attribute must have a single attribute value.It is expected that if UCS becomes an ASN.1 type(e.g., UNIVERSAL STRING),ChallengePassword will become a CHOICE type:ChallengePassword ::= CHOICE {PrintableString, T61String, UNIVERSAL STRING }5.2.2 Unstructured AddressThe unstructured-address attribute type specifies the address oraddresses of the subject of a certificate as an unstructured ASCII or T.61 string. The interpretation of the addresses is intended to bespecified by the issuer of the certificate; no particularinterpretation is required. A likely interpretation is as analternative to the X.520 postalAddress attribute type. Theunstructured-address attribute type is intended for PKCS #10Dusse, et. al. Informational [Page 12]certification requests.Unstructured-address attribute values haveASN.1 type UnstructuredAddress:UnstructuredAddress ::= CHOICE {PrintableString, T61String }An unstructured-address attribute can have multiple attribute values. Note: T.61’s newline character (hexadecimal code 0d) is recommendedas a line separator in multi-line addresses.It is expected that if UCS becomes an ASN.1 type (e.g., UNIVERSALSTRING), UnstructuredAddress will become a CHOICE type:UnstructuredAddress ::= CHOICE {PrintableString, T61String, UNIVERSAL STRING }5.3 Fulfilling a Certification RequestCertification authorities SHOULD use the sha-1WithRSAEncryptionsignature algorithms when signing certificates.5.4 Using PKCS #7 for Fulfilled Certificate Response[PKCS-7] supports a degenerate case of the SignedData content typewhere there are no signers on the content (and hence, the contentvalue is "irrelevant"). This degenerate case is used to conveycertificate and CRL information. Certification authorities MUST usethis format for returning certificate information resulting from the successful fulfillment of a certification request. At a minimum, the fulfilled certificate response MUST include the actual subjectcertificate (corresponding to the information in the certificationrequest). The response SHOULD include other certificates which linkthe issuer to higher level certification authorities andcorresponding certificate-revocation lists. Unrelated certificatesand revocation information is also acceptable.Receiving agents MUST parse this degenerate PKCS #7 message type and handle the certificates and CRLs according to the requirements andrecommendations in Section 4.Dusse, et. al. Informational [Page 13]。