Translation:RELAX NG UCF Schema
From IDMLWiki
1.6 RELAX NG UCFスキーマ
<?xml version="1.0" encoding="UTF-8"?><choice xmlns="http://relaxng.org/ns/structure/1.0"><element name="container"><attribute name="version"><value>1.0</value>
</attribute><attribute name="xmlns"><value>urn:oasis:names:tc:opendocument:xmlns:container</value></attribute><optional><element name="rootfiles"><oneOrMore><element name="rootfile"><attribute name="full-path"><text/></attribute><attribute name="media-type"><text/></attribute></element></oneOrMore></element></optional><optional><element name="relationships"><oneOrMore><element name="relationship"><attribute name="type"><text/></attribute><attribute name="target"><text/></attribute></element></oneOrMore></element></optional></element><element name="signatures"><attribute name="xmlns"><value>urn:oasis:names:tc:opendocument:xmlns:container</value>
</attribute><oneOrMore><element name="Signature" ns="http://www.w3.org/2001/04/xmldsig#"><externalRefhref="http://www.w3.org/Signature/2002/07/xmldsig-core-schema.rng"/></element></oneOrMore></element><element name="encryption"><attribute name="xmlns"><value>urn:oasis:names:tc:opendocument:xmlns:container</value>
</attribute><oneOrMore><choice><element name="EncryptedData"ns="http://www.w3.org/2001/04/xmlenc#"><externalRefhref="http://www.w3.org/Encryption/2002/07/xenc-schema.rng"/></element><element name="EncryptedKey"ns="http://www.w3.org/2001/04/xmlenc#"><externalRefhref="http://www.w3.org/Encryption/2002/07/xenc-schema.rng"/></element></choice></oneOrMore></element></choice>
次の例は、Zipコンテナー内の代替のPDF表現が署名され暗号化されたOEBPSパブリケーションを含むためにこのUCFフォーマットの使用を実証します。
Zipコンテナ内のオーダーリスト:
mimetype META-INF/container.xml META-INF/signatures.xml META-INF/encryption.xml OEBPS/As You Like It.opf OEBPS/book.html OEBPS/images/cover.png PDF/As You Like It.pdf
mimetypeファイル:
application/epub+zip
META-INF/container.xmlファイル:
<?xml version="1.0"?><container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><rootfiles><rootfile full-path="OEBPS/As You Like It.opf"media-type="application/oebps-package+xml" /><rootfile full-path="OEBPS/As You Like It.pdf"media-type="application/pdf" /></rootfiles></container>
META-INF/signatures.xmlファイル:
<?xml version="1.0"?><signatures xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><Signature Id="AsYouLikeItSignature" xmlns="http://www.w3.org/2000/09/xmldsig#"><!-- SignedInfo is the information that is actually signed. In this case --><!-- the SHA1 algorithm is used to sign the canonical form of the XML --><!-- documents enumerated in the Object element below --><SignedInfo><CanonicalizationMethodAlgorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/><Reference URI="#AsYouLikeIt"><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>j6lwx3rvEPO0vKtMup4NbeVu8nk=</DigestValue>
</Reference></SignedInfo><!-- The signed value of the digest above using the DSA algorithm --><SignatureValue>MC0CFFrVLtRlk=...</SignatureValue>
<!-- The key to use to validate the signature --><KeyInfo><KeyValue><DSAKeyValue><P>...</P><Q>...</Q><G>...</G><Y>...</Y>
</DSAKeyValue></KeyValue></KeyInfo><!-- The list documents to sign. Note that the canonical form of XML --><!-- documents is signed while the binary form of the other documents --><!-- is used --><Object><Manifest Id="AsYouLikeIt"><Reference URI="OEBPS/As You Like It.opf"><Transforms><Transform Algorithm="http://www.w3.org/TR/2001/REC-xmlc14n-20010315"/></Transforms></Reference><Reference URI="OEBPS/book.html"><Transforms><Transform Algorithm="http://www.w3.org/TR/2001/REC-xmlc14n-20010315"/></Transforms></Reference><Reference URI="OEBPS/images/cover.png" /><Reference URI="PDF/As You Like It.pdf" /></Manifest></Object></Signature></signatures>
META-INF/encryption.xmlファイル:
<?xml version="1.0"?><encryptionxmlns="urn:oasis:names:tc:opendocument:xmlns:container"xmlns:enc="http://www.w3.org/2001/04/xmlenc#"xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><-- The RSA encrypted AES-128 symmetric key used to encrypt the data --><enc:EncryptedKey Id="EK"><enc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/><ds:KeyInfo><ds:KeyName>John Smith</ds:KeyName>
</ds:KeyInfo><enc:CipherData><enc:CipherValue>xyzabc...</enc:CipherValue>
</enc:CipherData></enc:EncryptedKey><!-- Each EncryptedData block identifies a single document that has been --><!-- encrypted using the AES-128 algorithm. The data remains stored in it’s --><!-- encrypted form in the original file within the container. --><enc:EncryptedData Id="ED1"><enc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128"/><ds:KeyInfo><ds:RetrievalMethod URI="#EK"Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey"/></ds:KeyInfo><enc:CipherData><enc:CipherReference URI="OEBPS/book.html"/></enc:CipherData></enc:EncryptedData><enc:EncryptedData Id="ED2"><enc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128"/><ds:KeyInfo><ds:RetrievalMethod URI="#EK"Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey"/></ds:KeyInfo><enc:CipherData><enc:CipherReference URI="OEBPS/images/cover.png"/></enc:CipherData></enc:EncryptedData><enc:EncryptedData Id="ED3"><enc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-aes128"/><enc:KeyInfo><enc:RetrievalMethod URI="#EK"Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey"/></enc:KeyInfo><enc:CipherData><enc:CipherReference URI="PDF/As You Like It.pdf"/></enc:CipherData></enc:EncryptedData></encryption>
OEBPS/As You Like It.opfファイル:
<?xml version="1.0"?><!DOCTYPE package PUBLIC "+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN""http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd"><package unique-identifier="Package-ID"><metadata><dc-metadata xmlns:dc="http://purl.org/dc/elements/1.0"xmlns:oebpackage="http://openebook.org/namespaces/oebpackage/1.0"><dc:Identifier id="Package-ID">ebook:guid-6B2DF0030656ED9D8</dc:Identifier>
<dc:Title>As You Like It</dc:Title>
<dc:Creator role="aut">William Shakespeare</dc:Creator>
<dc:Identifier>0-7410-1455-6</dc:Identifier>
<dc:Subject></dc:Subject><dc:Type></dc:Type><dc:Date event="publication">3/24/2000</dc:Date>
<dc:Date event="copyright">1/1/9999</dc:Date>
<dc:Identifier scheme="ISBN">0-7410-1455-6</dc:Identifier>
<dc:Publisher>Project Gutenberg</dc:Publisher>
<dc:Language></dc:Language></dc-metadata></metadata><manifest><item id="4915" href="book.html" media-type="text/x-oeb1-document"/><item id="7184" href="images/cover.png" media-type="image/png" /></manifest><spine><itemref idref="4915"/></spine></package>
OEBPS/book.htmlファイル:
このファイルは、暗号化されたバイナリでしょう。復号した内容は次のもののように見えるかもしれません:
<?xml version="1.0" ?><!DOCTYPE html PUBLIC"+//ISBN 0-9673008-1-9//DTD OEB 1.2 Document//EN""http://openebook.org/dtds/oeb-1.2/oebdoc12.dtd"><html><head>...
</head><body>...
<img src="images/cover.png" alt="Cover image: a picture of the Bard of Avon" />...
</body></html>
OEBPS/images/cover.pngファイル:
このファイルの内容はcover.pngファイルの暗号化されたバイナリです。
OEBPS/As You Like It.pdfファイル:
このファイルの内容はPDFファイルの暗号化されたバイナリです。
