]>
Raphaël G. Git Repositories - acme/blob - Acme.pm
e4637d790ee19b87ed1f1c9748852d4d3d782cd0
1 # This file is part of Acmepl
3 # Acmepl is is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 # Copyright (C) 2016 - 2017 Raphaël Gertz <acme@rapsys.eu>
26 use filetest
qw(access) ;
30 our @ISA = qw(Exporter) ;
31 our @EXPORT_OK = qw(VERSION) ;
34 use Carp
qw(carp confess) ;
35 use Date
:: Parse
qw(str2time) ;
37 use Digest
:: SHA
qw(sha256_base64) ;
39 use File
:: Copy
qw(copy) ;
40 use File
:: Path
qw(make_path) ;
41 use File
:: Slurp
qw(read_file write_file) ;
42 use File
:: stat qw(stat) ;
43 use File
:: Temp
; # qw( :seekable );
44 use IPC
:: System
:: Simple
qw(capturex) ;
45 use JSON
qw(from_json to_json) ;
47 use MIME
:: Base64
qw(encode_base64url encode_base64) ;
49 use POSIX
qw(EXIT_FAILURE) ;
56 #XXX: see https://letsencrypt.github.io/acme-spec/ (probably based on https://ietf-wg-acme.github.io/acme/)
57 #XXX: see jwk rfc http://www.rfc-editor.org/rfc/rfc7517.txt
58 #XXX: see javascript implementation https://github.com/diafygi/gethttpsforfree/blob/gh-pages/js/index.js
62 # Request certificate file name
63 REQUEST_CSR
=> 'request.der' ,
72 ACME_CERT
=> 'https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem' ,
73 ACME_DIR
=> 'https://acme-staging.api.letsencrypt.org/directory' ,
74 ACME_PROD_DIR
=> 'https://acme-v01.api.letsencrypt.org/directory' ,
87 #XXX: tie to Tie::IxHash to keep a stable ordering of hash keys
96 # kty => uc(KEY_TYPE),
101 # thumbprint => undef
103 tie
( our %jwk , 'Tie::IxHash' , pubkey
=> undef , jwk
=> undef , thumbprint
=> undef );
104 tie
(%{ $jwk { jwk
}}, 'Tie::IxHash' , alg
=> 'RS256' , jwk
=> undef );
105 #XXX: strict ordering only really needed here for thumbprint sha256 digest
106 tie
(%{ $jwk { jwk
}{ jwk
}}, 'Tie::IxHash' , e
=> undef , kty
=> uc ( KEY_TYPE
), n
=> undef );
111 my ( $class , $debug , $domain , $config ) = @_ ;
116 # Link self to package
117 bless ( $self , $class );
120 $self ->{ debug
} = $debug ;
123 $self ->{ domain
} = $domain ;
126 $self ->{ config
} = $config ;
129 @{ $self ->{ domains
}} = ( $domain ->{ domain
}, @{ $domain ->{ domains
}});
131 # Add extra check to mail validity
132 #XXX: mxcheck fail if there is only a A record on the domain
133 my $ev = Email
:: Valid-
> new (- fqdn
=> 1 , - tldcheck
=> 1 , - mxcheck
=> 1 );
135 # Show error if check fail
136 if (! defined $ev -> address ( $self ->{ domain
}{ mail
})) {
137 map { carp
'failed check: ' . $_ if ( $self ->{ debug
}) } $ev -> details ();
138 confess
'Email::Valid->address failed' ;
142 $self ->{ mail
} = $self ->{ domain
}{ mail
};
145 my $res = new Net
:: DNS
:: Resolver
();
152 unless (( $tld ) = $_ =~ m/\.(\w+)$/ ) {
153 confess
$_ . ' \' s tld extraction failed' ;
156 # Check if tld exists
157 unless ( Net
:: Domain
:: TLD
:: tld_exists
( $tld )) {
158 confess
$tld . ' tld from ' . $_ . ' don \' t exists' ;
161 # Check if we get dns answer
162 #XXX: only search A type because letsencrypt don't support ipv6 (AAAA) yet
163 unless ( my $rep = $res -> search ( $_ , 'A' )) {
164 confess
'search A record for ' . $_ . ' failed' ;
166 unless ( scalar map { $_ -> type eq 'A' ? 1 : (); } $rep -> answer ) {
167 confess
'search recursively A record for ' . $_ . ' failed' ;
170 } @{ $self ->{ domains
}};
172 # Return class reference
176 # Prepare environement
180 # Extract cert directory and filename
181 my ( $certFile , $certDir ) = File
:: Spec-
> splitpath ( $self ->{ domain
}{ cert
});
183 # Extract key directory and filename
184 my ( $keyFile , $keyDir ) = File
:: Spec-
> splitpath ( $self ->{ domain
}{ key
});
186 # Extract account directory and filename
187 my ( $accountFile , $accountDir ) = File
:: Spec-
> splitpath ( $self ->{ domain
}{ account
});
191 make_path
( $certDir , $keyDir , $accountDir , $self ->{ config
}{ pending
}. '/' . $self ->{ mail
}. '.' .( $self ->{ domain
}{ prod
} ? 'prod' : 'staging' ), { error
=> \
my $err });
194 my ( $file , $msg ) = %$_ ;
195 carp
( $file eq '' ? '' : $file . ': ' ). $msg if ( $self ->{ debug
});
197 confess
'make_path failed' ;
202 $ua = LWP
:: UserAgent-
> new ;
203 $ua -> agent ( __PACKAGE__
. '/' . VERSION
);
205 # Check that certificate is writable
206 unless (- w
$certDir || - w
$self ->{ domain
}{ cert
}) {
207 confess
( 'Directory ' . $certDir . ' or file ' . $self ->{ domain
}{ cert
}. ' must be writable: ' . $! );
210 # Check that key is writable
211 unless (- r
$self ->{ domain
}{ key
} || - w
$keyDir ) {
212 confess
( 'File ' . $self ->{ domain
}{ key
}. ' must be readable or directory ' . $keyDir . ' must be writable: ' . $! );
215 # Check that account is writable
216 unless (- r
$self ->{ domain
}{ account
} || - w
$accountDir ) {
217 confess
( 'File ' . $self ->{ domain
}{ account
}. ' must be readable or directory ' . $accountDir . ' must be writable: ' . $! );
220 # Backup old certificate if possible
221 if (- w
$certDir && - f
$self ->{ domain
}{ cert
}) {
222 my ( $dt , $suffix ) = undef ;
224 # Extract datetime suffix
225 $suffix = ( $dt = DateTime-
> from_epoch ( epoch
=> stat ( $self ->{ domain
}{ cert
})-> mtime ))-> ymd ( '' ). $dt -> hms ( '' );
227 # Rename old certificate
228 unless ( copy
( $self ->{ domain
}{ cert
}, $self ->{ domain
}{ cert
}. '.' . $suffix )) {
229 carp
( 'Copy ' . $self ->{ domain
}{ cert
}. ' to ' . $self ->{ domain
}{ cert
}. '.' . $suffix . ' failed: ' . $! );
237 open ( $_stderr , '>&STDERR' ) or die $! ;
239 close ( STDERR
) or die $! ;
241 open ( STDERR
, '>' , '/dev/null' ) or die $! ;
249 open ( STDERR
, '>&' , $_stderr ) or die $! ;
252 # Generate required keys
256 # Generate account and server key if required
258 # Check key existence
263 #XXX: we drop stderr here because openssl can't be quiet on this command
264 capturex
( 'openssl' , ( 'genrsa' , '-out' , $_ , KEY_SIZE
));
268 } ( $self ->{ domain
}{ account
}, $self ->{ domain
}{ key
});
270 # Extract modulus and publicExponent jwk
271 #XXX: same here we tie to keep ordering
272 tie
(%{ $self ->{ account
}}, 'Tie::IxHash' , %jwk );
274 if ( /^Modulus=([0-9A-F]+)$/ ) {
275 # Extract to binary from hex and convert to base64 url
276 $self ->{ account
}{ jwk
}{ jwk
}{ n
} = encode_base64url
( pack ( "H*" , $1 ) =~ s/^\0+//r );
277 } elsif ( /^publicExponent:\s([0-9]+)\s\(0x[0-1]+\)$/ ) {
278 # Extract to binary from int, trim leading zeros and convert to base64 url
279 chomp ( $self ->{ account
}{ jwk
}{ jwk
}{ e
} = encode_base64url
( pack ( "N" , $1 ) =~ s/^\0+//r ));
281 } capturex
( 'openssl' , ( 'rsa' , '-text' , '-in' , $self ->{ domain
}{ account
}, '-noout' , '-modulus' ));
285 # Extract account public key
286 $self ->{ account
}{ pubkey
} = join ( '' , map { chomp ; $_ ; } capturex
( 'openssl' , ( 'rsa' , '-in' , $self ->{ domain
}{ account
}, '-pubout' )));
291 #XXX: convert base64 to base64 url
292 $self ->{ account
}{ thumbprint
} = ( sha256_base64
( to_json
( $self ->{ account
}{ jwk
}{ jwk
})) =~ s/=+\z//r ) =~ tr
[+/][- _
] r
;
295 # Generate certificate request
299 # Openssl config template
300 my $oct = File
:: Temp-
> new ();
302 # Save data start position
305 # Load template from data
306 map { s/__EMAIL_ADDRESS__/$self->{mail}/ ; s/__COMMON_NAME__/$self->{domains}[0]/ ; print $oct $_ ; } < DATA
>;
311 # Append domain names
313 map { print $oct 'DNS.' . $i++ . ' = ' . $_ . " \n " ; } @{ $self ->{ domains
}};
316 capturex
( 'openssl' , ( 'req' , '-new' , '-outform' , 'DER' , '-key' , $self ->{ domain
}{ key
}, '-config' , $oct -> filename , '-out' , $self ->{ config
}{ pending
}. '/' . $self ->{ mail
}. '.' .( $self ->{ domain
}{ prod
} ? 'prod' : 'staging' ). '/' . REQUEST_CSR
));
330 my $dir = $self ->{ prod
} ? ACME_PROD_DIR
: ACME_DIR
;
333 my $req = HTTP
:: Request-
> new ( GET
=> $dir . '?' . $time );
336 my $res = $ua -> request ( $req );
339 unless ( $res -> is_success ) {
340 confess
'GET ' . $dir . '?' . $time . ' failed: ' . $res -> status_line ;
344 $self ->{ nonce
} = $res -> headers ->{ 'replay-nonce' };
346 # Merge uris in self content
347 %$self = ( %$self , %{ from_json
( $res -> content )});
352 my ( $self , $uri , $payload ) = @_ ;
355 my $protected = encode_base64url
( to_json
({ nonce
=> $self ->{ nonce
}}));
358 $payload = encode_base64url
( to_json
( $payload ));
361 my $stf = File
:: Temp-
> new ();
363 # Append protect.payload to stf
364 print $stf $protected . '.' . $payload ;
369 # Generate digest of stf
370 my $signature = encode_base64url
( join ( '' , capturex
( 'openssl' , ( 'dgst' , '-sha256' , '-binary' , '-sign' , $self ->{ domain
}{ account
}, $stf -> filename ))) =~ s/^\0+//r );
373 my $req = HTTP
:: Request-
> new ( POST
=> $uri );
375 # Set new-reg request content
376 $req -> content ( to_json
({
377 header
=> $self ->{ account
}{ jwk
},
378 protected
=> $protected ,
380 signature
=> $signature
384 my $res = $ua -> request ( $req );
387 if ( defined $res -> headers ->{ 'replay-nonce' }) {
388 $self ->{ nonce
} = $res -> headers ->{ 'replay-nonce' };
395 # Resolve dns and check content
396 #XXX: see https://community.centminmod.com/threads/looks-like-letsencrypt-dns-01-is-ready.5845/#12 for example
398 my ( $self , $domain , $token ) = @_ ;
400 # Generate signature from content
401 my $signature = (( sha256_base64
( $token . '.' . $self ->{ account
}{ thumbprint
})) =~ s/=+\z//r ) =~ tr
[+/][- _
] r
;
404 $domain = '_acme-challenge.' . $domain . '.' ;
407 my $res = new Net
:: DNS
:: Resolver
();
409 # Check if we get dns answer
410 unless ( my $rep = $res -> search ( $domain , 'TXT' )) {
411 carp
'TXT record search for ' . $domain . ' failed' if ( $self ->{ debug
});
414 unless ( scalar map { $_ -> type eq 'TXT' && $_ -> txtdata =~ /^$signature$/ ? 1 : (); } $rep -> answer ) {
415 carp
'TXT record recursive search for ' . $domain . ' failed' if ( $self ->{ debug
});
423 # Get uri and check content
425 my ( $self , $domain , $token ) = @_ ;
428 my $req = HTTP
:: Request-
> new ( GET
=> 'http://' . $domain . '/.well-known/acme-challenge/' . $token );
430 # Check if thumbprint is writeable
431 if (- w
$self ->{ config
}{ thumbprint
}) {
432 # Try to write thumbprint
433 write_file
( $self ->{ config
}{ thumbprint
}, $self ->{ account
}{ thumbprint
});
437 my $res = $ua -> request ( $req );
440 unless ( $res -> is_success ) {
441 carp
'GET http://' . $domain . '/.well-known/acme-challenge/' . $token . ' failed: ' . $res -> status_line if ( $self ->{ debug
});
445 # Handle invalid content
446 unless ( $res -> content =~ /^$token.$self->{account}{thumbprint}\s*$/ ) {
447 carp
'GET http://' . $domain . '/.well-known/acme-challenge/' . $token . ' content match failed: /^' . $token . '.' . $self ->{ account
}{ thumbprint
}. '\s* $/ !~ ' . $res -> content if ( $self ->{ debug
});
456 #XXX: see doc at https://ietf-wg-acme.github.io/acme/#rfc.section.6.3
460 # Post new-reg request
461 #XXX: contact array may contain a tel:+33612345678 for example
462 my $res = $self -> _post ( $self ->{ 'new-reg' }, { resource
=> 'new-reg' , contact
=> [ 'mailto:' . $self ->{ mail
}], agreement
=> $self ->{ term
}});
465 unless ( $res -> is_success || $res -> code eq 409 ) {
466 confess
'POST ' . $self ->{ 'new-reg' }. ' failed: ' . $res -> status_line ;
469 # Update mail informations
470 if ( $res -> code eq 409 ) {
471 # Save registration uri
472 $self ->{ 'reg' } = $res -> headers ->{ location
};
475 #XXX: contact array may contain a tel:+33612345678 for example
476 $res = $self -> _post ( $self ->{ 'reg' }, { resource
=> 'reg' , contact
=> [ 'mailto:' . $self ->{ mail
}]});
479 unless ( $res -> is_success ) {
480 confess
'POST ' . $self ->{ 'reg' }. ' failed: ' . $res -> status_line ;
489 # Create challenges hash
490 %{ $self ->{ challenges
}} = ();
495 # Create or load auth request for each domain
501 my $file = $self ->{ config
}{ pending
}. '/' . $self ->{ mail
}. '.' .( $self ->{ domain
}{ prod
} ? 'prod' : 'staging' ). '/' . $_ ;
503 # Load auth request content or post a new one
504 #TODO: add more check on cache file ???
506 #XXX: use eval to workaround a fatal in from_json
508 # Check that file exists
511 ( $content = read_file
( $file )) &&
513 ( $content = from_json
( $content ))
515 } || ( str2time
( $content ->{ expires
}) <= time ()+ 3600 )
517 # Post new-authz request
518 my $res = $self -> _post ( $self ->{ 'new-authz' }, { resource
=> 'new-authz' , identifier
=> { type
=> 'dns' , value
=> $_ }, existing
=> 'accept' });
521 unless ( $res -> is_success ) {
522 confess
'POST ' . $self ->{ 'new-authz' }. ' for ' . $_ . ' failed: ' . $res -> status_line ;
526 $content = from_json
( $res -> content );
529 unless ( defined $content ->{ identifier
}{ value
} && $content ->{ identifier
}{ value
} eq $_ ) {
530 confess
'domain matching ' . $content ->{ identifier
}{ value
}. ' for ' . $_ . ' failed: ' . $res -> status_line ;
534 unless ( $content ->{ status
} eq 'valid' or $content ->{ status
} eq 'pending' ) {
535 confess
'POST ' . $self ->{ 'new-authz' }. ' for ' . $_ . ' failed: ' . $res -> status_line ;
539 write_file
( $file , to_json
( $content ));
543 %{ $self ->{ challenges
}{ $_ }} = (
544 status
=> $content ->{ status
},
545 expires
=> $content ->{ expires
},
550 if ( $content ->{ status
} eq 'pending' ) {
551 # Extract validation data
552 foreach my $challenge (@{ $content ->{ challenges
}}) {
553 # One test already validated this auth request
554 if ( $self ->{ challenges
}{ $_ }{ status
} eq 'valid' ) {
556 } elsif ( $challenge ->{ status
} eq 'valid' ) {
557 $self ->{ challenges
}{ $_ }{ status
} = $challenge ->{ status
};
559 } elsif ( $challenge ->{ status
} eq 'pending' ) {
562 ( $challenge ->{ type
} =~ /^http-01$/ and $self -> _httpCheck ( $_ , $challenge ->{ token
})) or
563 ( $challenge ->{ type
} =~ /^dns-01$/ and $self -> _dnsCheck ( $_ , $challenge ->{ token
}))
565 # Post challenge request
566 my $res = $self -> _post ( $challenge ->{ uri
}, { resource
=> 'challenge' , keyAuthorization
=> $challenge ->{ token
}. '.' . $self ->{ account
}{ thumbprint
}});
569 unless ( $res -> is_success ) {
570 confess
'POST ' . $challenge ->{ uri
}. ' failed: ' . $res -> status_line ;
574 my $content = from_json
( $res -> content );
577 if ( $content ->{ status
} eq 'valid' ) {
578 $self ->{ challenges
}{ $_ }{ status
} = $content ->{ status
};
579 # Check is still polling
580 } elsif ( $content ->{ status
} eq 'pending' ) {
581 # Add to poll list for later use
582 push (@{ $self ->{ challenges
}{ $_ }{ polls
}}, {
583 type
=> ( split ( /-/ , $challenge ->{ type
}))[ 0 ],
584 status
=> $content ->{ status
},
585 poll
=> $content ->{ uri
}
591 # Check if check is challenge still in pending and no polls
592 if ( $self ->{ challenges
}{ $_ }{ status
} eq 'pending' && scalar @{ $self ->{ challenges
}{ $_ }{ polls
}} == 0 ) {
593 # Loop on all remaining challenges
594 foreach my $challenge (@{ $content ->{ challenges
}}) {
595 # Display help for http-01 check
596 if ( $challenge ->{ type
} eq 'http-01' ) {
597 print STDERR
'Create URI http://' . $_ . '/.well-known/acme-challenge/' . $challenge ->{ token
}. ' with content ' . $challenge ->{ token
}. '.' . $self ->{ account
}{ thumbprint
}. " \n " ;
598 # Display help for dns-01 check
599 } elsif ( $challenge ->{ type
} eq 'dns-01' ) {
600 print STDERR
'Create TXT record _acme-challenge.' . $_ . '. with value ' .((( sha256_base64
( $challenge ->{ token
}. '.' . $self ->{ account
}{ thumbprint
})) =~ s/=+\z//r ) =~ tr
[+/][- _
] r
). " \n " ;
605 } @{ $self ->{ domains
}};
611 while (-- $remaining >= 0 and scalar map { $_ ->{ status
} eq 'valid' ? 1 : (); } values %{ $self ->{ challenges
}}) {
614 # Poll remaining pending
619 # Poll remaining polls
622 my $req = HTTP
:: Request-
> new ( GET
=> $_ ->{ poll
});
625 my $res = $ua -> request ( $req );
628 unless ( $res -> is_success ) {
629 carp
'GET ' . $self ->{ challenges
}{ $_ }{ http_challenge
}. ' failed: ' . $res -> status_line if ( $self ->{ debug
});
633 my $content = from_json
( $res -> content );
636 if ( $content ->{ status
} ne 'pending' ) {
637 $self ->{ challenges
}{ $domain }{ status
} = $content ->{ status
};
639 } @{ $self ->{ challenges
}{ $_ }{ polls
}};
640 } map { $self ->{ challenges
}{ $_ }{ status
} eq 'pending' ? $_ : (); } keys %{ $self ->{ challenges
}};
643 # Check if thumbprint is writeable
644 if (- w
$self ->{ config
}{ thumbprint
}) {
645 # Try to write thumbprint
646 write_file
( $self ->{ config
}{ thumbprint
}, '' );
649 # Stop here with remaining chanllenge
650 if ( scalar map { ! defined $_ ->{ status
} or $_ ->{ status
} ne 'valid' ? 1 : (); } values %{ $self ->{ challenges
}}) {
651 # Deactivate all activated domains
652 #XXX: not implemented by letsencrypt
654 # # Post deactivation request
655 # my $res = $self->_post($self->{challenges}{$_}{http_uri}, {resource => 'authz', status => 'deactivated'});
657 # unless ($res->is_success) {
658 # confess 'POST '.$self->{challenges}{$_}{http_uri}.' failed: '.$res->status_line;
660 #} map { $self->{challenges}{$_}{status} eq 'valid' ? $_ : () } keys %{$self->{challenges}};
662 # Stop here as a domain of csr list failed authorization
663 if ( $self ->{ debug
}) {
664 my @domains = map { ! defined $self ->{ challenges
}{ $_ }{ status
} or $self ->{ challenges
}{ $_ }{ status
} ne 'valid' ? $_ : (); } keys %{ $self ->{ challenges
}};
665 confess
'Fix the challenge' .( scalar @domains > 1 ? 's' : '' ). ' for domain' .( scalar @domains > 1 ? 's' : '' ). ': ' . join ( ', ' , @domains );
677 open ( my $fh , '<' , $self ->{ config
}{ pending
}. '/' . $self ->{ mail
}. '.' .( $self ->{ domain
}{ prod
} ? 'prod' : 'staging' ). '/' . REQUEST_CSR
) or die $! ;
680 my $csr = encode_base64url
( join ( '' , < $fh >) =~ s/^\0+//r );
683 close ( $fh ) or die $! ;
685 # Post certificate request
686 my $res = $self -> _post ( $self ->{ 'new-cert' }, { resource
=> 'new-cert' , csr
=> $csr });
689 unless ( $res -> is_success ) {
690 confess
'POST ' . $self ->{ 'new-cert' }. ' failed: ' . $res -> status_line ;
694 open ( $fh , '>' , $self ->{ domain
}{ cert
}) or die $! ;
697 print $fh '-----BEGIN CERTIFICATE-----' . " \n " . encode_base64
( $res -> content ). '-----END CERTIFICATE-----' . " \n " ;
700 my $req = HTTP
:: Request-
> new ( GET
=> ACME_CERT
);
703 $res = $ua -> request ( $req );
706 unless ( $res -> is_success ) {
707 carp
'GET ' . ACME_CERT
. ' failed: ' . $res -> status_line if ( $self ->{ debug
});
711 print $fh $res -> content ;
714 close ( $fh ) or die $! ;
717 carp
'Success, pem certificate in ' . $self ->{ domain
}{ cert
} if ( $self ->{ debug
});
724 # OpenSSL configuration file.
725 # This is mostly being used for generation of certificate requests.
732 distinguished_name
= req_distinguished_name
733 # The extentions to add to the self signed cert
734 x509_extensions
= v3_ca
735 # The extensions to add to a certificate request
736 req_extensions
= v3_req
738 # This sets a mask for permitted string types. There are several options.
739 # utf8only: only UTF8Strings (PKIX recommendation after 2004).
740 # WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
741 string_mask
= utf8only
743 [ req_distinguished_name
]
745 stateOrProvinceName
= State
or Province Name
746 localityName
= Locality Name
747 organizationName
= Organization Name
748 organizationalUnitName
= Organizational Unit Name
749 commonName
= __COMMON_NAME__
750 emailAddress
= __EMAIL_ADDRESS__
753 basicConstraints
= CA
: false
754 keyUsage
= nonRepudiation
, digitalSignature
, keyEncipherment
755 subjectAltName
= email
: move
756 subjectAltName
= @alt_names
759 subjectKeyIdentifier
= hash
760 authorityKeyIdentifier
= keyid
: always
, issuer
761 basicConstraints
= CA
: true