public key version 0.2



Similar documents
public_key Copyright Ericsson AB, All Rights Reserved public_key September 22, 2015

MTAT Applied Cryptography

Certification Authority. The X.509 standard, PKI and electronic documents. X.509 certificates. X.509 version 3. Critical extensions.

COMMON PKI SPECIFICATIONS FOR INTEROPERABLE APPLICATIONS FROM T7 & TELETRUST SPECIFICATION INTRODUCTION

Technical description of X.509 and UN/EDIFACT certificates. Specific user requirements on certificate data elements mapping

What Your Mother Didn't Tell You About PEM, DER, PKCS. Eric Norman University of Wisconsin-Madison

DEPARTMENT OF DEFENSE PUBLIC KEY INFRASTRUCTURE EXTERNAL CERTIFICATION AUTHORITY MASTER TEST PLAN VERSION 1.0

PKI and OpenSSL part 1 X.509 from the user s and the client software s point of view

Certificate Path Validation

ETSI TS V1.1.1 ( )

Middleware and Distributed Systems. Security. Martin v. Löwis

Information Systems Security Management

Prepared By: P Lichen. P Xulu

Interoperability Guidelines for Digital Signature Certificates issued under Information Technology Act

Secure Socket Layer. version 3.9

X.509 Certificate Generator User Manual

Programme of Requirements part 3h: Certificate Policy Server certificates Private Services Domain (G3)

OFFICE OF THE CONTROLLER OF CERTIFICATION AUTHORITIES TECHNICAL REQUIREMENTS FOR AUDIT OF CERTIFICATION AUTHORITIES

All your private keys are belong to us

Implementation Problems on PKI

Lecture 13: Certificates, Digital Signatures, and the Diffie-Hellman Key Exchange Algorithm. Lecture Notes on Computer and Network Security

Apple Certificate Library Functional Specification

Guidelines for the Selection, Configuration, and Use of Transport Layer Security (TLS) Implementations

Alternate Representations of the Public Key Cryptography Standards (PKCS) Using S-Expressions, S-PKCS

Certificate Policy for. SSL Client & S/MIME Certificates

Security Issues of the Digital Certificates within Public Key Infrastructures

Factory Application Certificates and Keys Products: SB700EX, SB70LC

Certificates and network security

Ciphermail S/MIME Setup Guide

Deploying Certificates with Cisco pxgrid. Using Self-Signed Certificates with ISE pxgrid node and pxgrid Client

SECURITY IN ELECTRONIC COMMERCE MULTIPLE-CHOICE QUESTIONS

Specifikationsdokument for OCES II

X.509 and SSL. A look into the complex world of X.509 and SSL UUASC 07/05/07. Phil Dibowitz

MACHINE READABLE TRAVEL DOCUMENTS

OpenCA v (ten-ten 2 )

X.509 Certificates. PKI: The OSI of a new generation

Certificate Policy for OCES Employee Certificates (Public Certificates for Electronic Services) Version 5

Biometrics, Tokens, & Public Key Certificates

Configuring SSL Termination

SEC 4: Elliptic Curve Qu-Vanstone Implicit Certificate Scheme (ECQV)

Purpose of PKI PUBLIC KEY INFRASTRUCTURE (PKI) Terminology in PKIs. Chain of Certificates

ech-0113: SuisseID specification

Package PKI. July 28, 2015

I N F O R M A T I O N S E C U R I T Y

GNUTLS. a Transport Layer Security Library This is a Draft document Applies to GnuTLS by Nikos Mavroyanopoulos

SSL/TLS/X.509. Aggelos Kiayias

Package PKI. February 20, 2013

Windows Server 2008 PKI and Certificate Security

A Security Flaw in the X.509 Standard Santosh Chokhani CygnaCom Solutions, Inc. Abstract

SWITCHaai Metadata CA. Certificate Policy and Certification Practice Statement

Tiscali Secure CA Certificate Policy and Certification Practices Statement

Public Key Infrastructure

Grid Computing - X.509

SPECIFIC DOCUMENTATION FOR CORPORATE CERTIFICATES

I N F O R M A T I O N S E C U R I T Y

SECURITY IN ELECTRONIC COMMERCE - SOLUTION MULTIPLE-CHOICE QUESTIONS

Certificate Policy for OCES personal certificates (Public Certificates for Electronic Services)

Understanding Digital Certificates on z/os Vanguard Las Vegas, NV Session AST3 June 26th 2012

Echoworx Encryption Services UK CA Certificate Policy and Certification Practices Statement

Towards a Secure and User Friendly Authentication Method for Public Wireless Networks Carolin Latze University of Fribourg Switzerland

Bank link technical specifications. Information for programmers

PEXA Public Key Infrastructure (PKI) Certification Authority Certificate Policy

Netzwerksicherheit Übung 6 SSL/TLS, OpenSSL

Digital Signatures in a PDF

Certification Service Provider of the Ministry of Employment and Social Security. Profile for Public Employee certificates

Displaying SSL Certificate and Key Pair Information

ATSC Standard: ATSC Interaction Channel Protocols

Displaying SSL Certificate and Key Pair Information

Certipost Trust Services. Certificate Policy. for Lightweight Certificates for EUROCONTROL. Version 1.2. Effective date 03 May 2012

SSL/TLS Hands-on Thomas Herlea

Detailed Specifications

Software Version 4.5. SSL Web Service API Release Date: 12 th May, InCommon c/o Internet Oakbrook Drive, Suite 300 Ann Arbor MI, 48104

APNIC Trial of Certification of IP Addresses and ASes

Bugzilla ID: Bugzilla Summary:

БЪЛГАРИЯ (BULGARIA) : Trusted List

Notification Services for the Server-Based Certificate Validation Protocol

Secure Sockets Layer (SSL ) / Transport Layer Security (TLS) Network Security Products S31213

2. Cryptography 2.4 Digital Signatures

Digital Certificates Demystified

Luxembourg (Luxembourg): Trusted List

Understanding Digital Certificates on z/os Share Anaheim, CA Session 8349 March 2nd 2011

UNITED KINGDOM (UNITED KINGDOM) : Trusted List

Transcription:

version 0.2

Typeset in L A TEX from SGML source using the DocBuilder-0.9.8.4 Document System.

Contents 1 User s Guide 1 1.1 Introduction.......................................... 1 1.1.1 Purpose........................................ 1 1.1.2 Prerequisites..................................... 1 1.2 Public key records....................................... 1 1.2.1 RSA as defined by the PKCS-1 standard and RFC 3447.............. 2 1.2.2 DSA as defined by Digital Signature Standard (NIST FIPS PUB 186-2)..... 2 1.3 Certificate records...................................... 2 1.3.1 Common Data Types................................. 3 1.3.2 PKIX Certificates.................................. 3 1.3.3 Standard certificate extensions............................ 5 1.3.4 Private Internet Extensions.............................. 8 1.3.5 CRL and CRL Extensions Profile.......................... 8 2 Reference Manual 11 2.1.......................................... 12 List of Tables 15 iii

iv

Chapter 1 User s Guide This application provides an API to infrastructure from RFC 3280 (X.509 certificates) and some formats defined by the PKCS-standard. 1.1 Introduction 1.1.1 Purpose This application provides an API to infrastructure from RFC 3280 (X.509 certificates) and formats defined by the PKCS-standard. 1.1.2 Prerequisites It is assumed that the reader is familiar with the Erlang programming language, concepts of OTP and has a basic understanding of the consepts of using s. 1.2 Public key records This chapter briefly describes Erlang records derived from asn1 specifications used to handle public and private keys. The intent is to describe the data types and not to specify the meaning of each component for this we refer you to the relevant standards and RFCs. Use the following include directive to get access to the records and constant macros used in the following sections. -include_lib("public_key/include/public_key.hrl"). 1

Chapter 1: User s Guide 1.2.1 RSA as defined by the PKCS-1 standard and RFC 3447. # RSAPublicKey { modulus, % integer() publicexponent % integer() # RSAPrivateKey { version, % two-prime multi modulus, % integer() publicexponent, % integer() privateexponent, % integer() prime1, % integer() prime2, % integer() exponent1, % integer() exponent2, % integer() coefficient, % integer() otherprimeinfos % [#OtherPrimeInfo{}] asn1_novalue # OtherPrimeInfo { prime, exponent, coefficient % integer() % integer() % integer() 1.2.2 DSA as defined by Digital Signature Standard (NIST FIPS PUB 186-2) # DSAPrivateKey,{ version, % integer() p, % integer() q, % integer() g, % integer() y, % integer() x % integer() # Dss-Parms,{ p, % integer() q, % integer() g % integer() 1.3 Certificate records This chapter briefly describes erlang records derived from asn1 specifications used to handle X509 certificates. The intent is to describe the data types and not to specify the meaning of each component for this we refer you to RFC 3280. Use the following include directive to get access to the records and constant macros described in the following sections. 2

1.3: Certificate records -include_lib("public_key/include/public_key.hrl"). 1.3.1 Common Data Types Common non standard erlang data types used to described the record fields in the below sections are defined in reference manual [page 12] or follows here. time() = uct time() general time() uct time() = utctime, "YYMMDDHHMMSSZ" general time() = generaltime, "YYYYMMDDHHMMSSZ" general name() = rfc822name, string() dnsname, string() x400address, string() directoryname, rdnsequence, [#AttributeTypeAndValue ] eidpartyname, special string() eidpartyname, special string(), special string() uniformresourceidentifier, string() ipaddress, string() registeredid, oid() othername, term() special string() = teletexstring, string() printablestring, string() universalstring, string() utf8string, string() bmpstring, string() dist reason() = unused keycompromise cacompromise affiliationchanged superseded cessationofoperation certificatehold privilegewithdrawn aacompromise 1.3.2 PKIX Certificates # Certificate { tbscertificate, signaturealgorithm, signature % # TBSCertificate {} % # AlgorithmIdentifier {} % {0, binary()} - asn1 compact bitstring # TBSCertificate { version, % v1 v2 v3 serialnumber, % integer() signature, % # AlgorithmIdentifier {} issuer, % {rdnsequence, [#AttributeTypeAndValue {}]} validity, % # Validity {} subject, % {rdnsequence, [#AttributeTypeAndValue {}]} subjectpublickeyinfo, % # SubjectPublicKeyInfo {} issueruniqueid, % binary() asn1_novalue subjectuniqueid, % binary() asn1_novalue extensions % [# Extension {}] # AlgorithmIdentifier { algorithm, % oid() parameters % asn1_der_encoded() # SignatureAlgorithm { algorithm, % id_signature_algorithm() parameters % public_key_params() 3

Chapter 1: User s Guide id signature algorithm() =?oid name as erlang atom for available oid names see table below. Ex:? id-dsa-with-sha1 OID name id-dsa-with-sha1 md2withrsaencryption md5withrsaencryption sha1withrsaencryption ecdsa-with-sha1 Table 1.1: Signature algorithm oids # AttributeTypeAndValue { type, % id_attributes() value % term() id attributes() =?oid name as erlang atom for available oid names see table below. Ex:? id-at-name OID name id-at-name id-at-surname id-at-givenname id-at-initials id-at-generationqualifier id-at-commonname id-at-localityname id-at-stateorprovincename id-at-organizationname id-at-title id-at-dnqualifier id-at-countryname id-at-serialnumber id-at-pseudonym Value type special string() special string() special string() special string() special string() special string() special string() special string() special string() special string() printablestring, string() printablestring, string() printablestring, string() special string() Table 1.2: Attribute oids # Validity { notbefore, % time() notafter % time() # SubjectPublicKeyInfo { algorithm, % #AlgorithmIdentifier{} subjectpublickey % binary() 4

1.3: Certificate records # SubjectPublicKeyInfoAlgorithm { algorithm, % id_public_key_algorithm() parameters % public_key_params() id algorithm() =?oid name as erlang atom for available oid names see table below. Ex:? id-dsa OID name rsaencryption id-dsa dhpublicnumber ecdsa-with-sha1 id-keyexchangealgorithm Table 1.3: Public key algorithm oids # Extension { extnid, critical, extnvalue % id_extensions() oid() % boolean() % asn1_der_encoded() id extensions() =?oid name as erlang atom for available oid names see tables. Ex:? id-ce-authoritykeyidentifier Standard Certificate Extensions [page 5], Private Internet Extensions [page 8], CRL Extensions [page 9] and CRL Entry Extensions [page 9]. 1.3.3 Standard certificate extensions OID name id-ce-authoritykeyidentifier id-ce-subjectkeyidentifier id-ce-keyusage id-ce-privatekeyusageperiod id-ce-certificatepolicies id-ce-policymappings id-ce-subjectaltname id-ce-issueraltname id-ce-subjectdirectoryattributes id-ce-basicconstraints id-ce-nameconstraints Value type # AuthorityKeyIdentifier oid() [key usasge()] # PrivateKeyUsagePeriod # PolicyInformation # PolicyMappings SEQOF general name() general name() [# Attribute ] # BasicConstraints # NameConstraints continued... 5

Chapter 1: User s Guide... continued id-ce-policyconstraints id-ce-extkeyusage id-ce-crldistributionpoints id-ce-inhibitanypolicy id-ce-freshestcrl # PolicyConstraints [id key purpose()] # DistributionPoint integer() [# DistributionPoint ] Table 1.4: Standard Certificate Extensions key usasge() = digitalsignature nonrepudiation keyencipherment dataencipherment keyagreement keycertsign crlsign encipheronly decipheronly id key purpose() =?oid name as erlang atom for available oid names see table below. Ex:? id-kp-serverauth OID name id-kp-serverauth id-kp-clientauth id-kp-codesigning id-kp-emailprotection id-kp-timestamping id-kp-ocspsigning Table 1.5: Key purpose oids # AuthorityKeyIdentifier { keyidentifier, % oid() authoritycertissuer, % general_name() authoritycertserialnumber % integer() # PrivateKeyUsagePeriod { notbefore, % general_time() notafter % general_time() # PolicyInformation { policyidentifier, policyqualifiers # PolicyQualifierInfo { policyqualifierid, qualifier % oid() % [#PolicyQualifierInfo{}] % oid() % string() # UserNotice {} # UserNotice { noticeref, % # NoticeReference {} explicittext % string() 6

1.3: Certificate records # NoticeReference { organization, noticenumbers % string() % [integer()] # PolicyMappings_SEQOF { issuerdomainpolicy, subjectdomainpolicy % oid() % oid() # Attribute { type, % oid() values % [asn1_der_encoded()] }). # BasicConstraints { ca, % boolean() pathlenconstraint % integer() }). # NameConstraints { permittedsubtrees, % [# GeneralSubtree {}] excludedsubtrees % [# GeneralSubtree {}] }). # GeneralSubtree { base, % general_name() minimum, % integer() maximum % integer() }). # PolicyConstraints { requireexplicitpolicy, % integer() inhibitpolicymapping % integer() }). # DistributionPoint { distributionpoint, % general_name() [#AttributeTypeAndValue{}] reasons, % [dist_reason()] crlissuer % general_name() }). 7

Chapter 1: User s Guide 1.3.4 Private Internet Extensions OID name id-pe-authorityinfoaccess id-pe-subjectinfoaccess Value type [# AccessDescription ] [# AccessDescription ] Table 1.6: Private Internet Extensions # AccessDescription { accessmethod, accesslocation }). % oid() % general_name() 1.3.5 CRL and CRL Extensions Profile # CertificateList { tbscertlist, % # TBSCertList{} signaturealgorithm, % # AlgorithmIdentifier {} signature % {0, binary()} - asn1 compact bitstring }). # TBSCertList { version, % v2 (if defined) signature, % #AlgorithmIdentifier{} issuer, % {rdnsequence, [#AttributeTypeAndValue {}]} thisupdate, % time() nextupdate, % time() revokedcertificates, % [# TBSCertList_revokedCertificates_SEQOF {}] crlextensions % [# Extension {}] }). # TBSCertList_revokedCertificates_SEQOF { usercertificate, % integer() revocationdate, % timer() crlentryextensions % [# Extension {}] }). 8

1.3: Certificate records CRL Extensions OID name id-ce-authoritykeyidentifier id-ce-issueraltname id-ce-crlnumber id-ce-deltacrlindicator id-ce-issuingdistributionpoint id-ce-freshestcrl Value type # AuthorityKeyIdentifier rdnsequence, [#AttributeTypeAndValue ] integer() integer() # IssuingDistributionPoint [# Distributionpoint ] Table 1.7: CRL Extensions # IssuingDistributionPoint { distributionpoint, % general_name() [#AttributeTypeAndValue {}] onlycontainsusercerts, % boolean() onlycontainscacerts, % boolean() onlysomereasons, % [dist_reason()] indirectcrl, % boolean() onlycontainsattributecerts % boolean() }). CRL Entry Extensions OID name id-ce-crlreason id-ce-holdinstructioncode id-ce-invaliditydate id-ce-certificateissuer Value type crl reason() oid() general time() general name() Table 1.8: CRL Entry Extensions crl reason() = unspecified keycompromise cacompromise affiliationchanged superseded cessationofoperation certificatehold removefromcrl privilegewithdrawn aacompromise 9

Chapter 1: User s Guide 10

Reference Manual Short Summaries Erlang Module [page 12] API module for infrastructure. The following functions are exported: decode private key(keyinfo) - [page 13] Decodes an asn1 der encoded private key. decode private key(keyinfo, Password) - ok, PrivateKey error, Reason [page 13] Decodes an asn1 der encoded private key. pem to der(file) - ok, [Entry] [page 13] Reads a PEM file and translates it into its asn1 der encoded parts. pkix decode cert(cert, Type) - ok, DecodedCert error, Reason [page 13] Decodes an asn1 der encoded pkix certificate. 11

Reference Manual Erlang Module This module provides functions to handle infrastructure from RFC 3280 - X.509 certificates (will later be upraded to RFC 5280) and some parts of the PKCS-standard. Currently this application is mainly used by the new ssl implementation. The API is yet under construction and only a few of the functions are currently documented and thereby supported. COMMON DATA TYPES Note: All records used in this manual are generated from asn1 specifications and are documented in the User s Guide. See Public key records [page 1] and X.509 Certificate records [page 2]. Use the following include directive to get access to the records and constant macros described here and in the User s Guide. -include_lib("public_key/include/public_key.hrl"). Data Types boolean() = true false string = [bytes()] asn1 der encoded() = binary() [bytes()] der bin() = binary() oid() - a tuple of integers as generated by the asn1 compiler. () = rsa () dsa () rsa () = # RSAPublicKey rsa private key() = # RSAPrivateKey dsa () = integer() params() = dsa key params() dsa key params() = # Dss-Parms private key() = rsa private key() dsa private key() rsa private key() = # RSAPrivateKey dsa private key() = # DSAPrivateKey x509 certificate() = "#Certificate " 12

Reference Manual x509 tbs certificate() = # TBSCertificate Exports decode private key(keyinfo) - decode private key(keyinfo, Password) - ok, PrivateKey error, Reason Types: KeyInfo = KeyType, der bin(), ChipherInfo As returned from pem to der/1 for private keys KeyType = rsa private key dsa private key ChipherInfo = opaque() no encryption ChipherInfo may contain encryption parameters if the private key is password protected, these are opaque to the user just pass the value returned by pem to der/1 to this function. Password = string() Must be specified if CipherInfo =/= no encryption PrivateKey = private key() Reason = term() Decodes an asn1 der encoded private key. pem to der(file) - ok, [Entry] Types: File = path() Password = string() Entry = entry type(), der bin(), CipherInfo ChipherInfo = opaque() no encryption ChipherInfo may contain encryption parameters if the private key is password protected, these will be handled by the function decode private key/2. entry type() = cert cert req rsa private key dsa private key dh params Reads a PEM file and translates it into its asn1 der encoded parts. pkix decode cert(cert, Type) - ok, DecodedCert error, Reason Types: Cert = asn1 der encoded() Type = plain otp DecodeCert = x509 certificate() When type is specified as otp the asn1 spec OTP-PKIX.asn1 is used to decode known extensions and enhance the signature field in # Certificate and #TBSCertificate. This is currently used by the new ssl implementation but not documented and supported for the application. Reason = term() Decodes an asn1 encoded pkix certificate. 13

Reference Manual 14

List of Tables 1.1 Signature algorithm oids.................................... 4 1.2 Attribute oids......................................... 4 1.3 Public key algorithm oids................................... 5 1.4 Standard Certificate Extensions................................ 6 1.5 Key purpose oids........................................ 6 1.6 Private Internet Extensions................................... 8 1.7 CRL Extensions......................................... 9 1.8 CRL Entry Extensions..................................... 9 15

List of Tables 16

Index of Modules and Functions Modules are typed in this way. Functions are typed in this way. decode_private_key/1,13 decode_private_key/2,13 pem_to_der/1,13 pkix_decode_cert/2,13 decode_private_key/1,13 decode_private_key/2,13 pem_to_der/1,13 pkix_decode_cert/2,13 17

Index of Modules and Functions 18