1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/integration-cli/fixtures/notary/gen.sh
cyli 0797af39c2 Fix API incompatibilities between notary v0.3.0 and v0.4.2:
- some function signatures have changed - use the new ones
- re-generate the notary delegation key certs, since notary doesn't allow SHA1
- fix some error message mapping because now if a root rotation fails to validate trusted operations will fail

Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-10-14 17:53:34 -07:00

18 lines
731 B
Bash
Executable file

for selfsigned in delgkey1 delgkey2 delgkey3 delgkey4; do
subj='/C=US/ST=CA/L=SanFrancisco/O=Docker/CN=delegation'
openssl genrsa -out "${selfsigned}.key" 2048
openssl req -new -key "${selfsigned}.key" -out "${selfsigned}.csr" -sha256 -subj "${subj}"
cat > "${selfsigned}.cnf" <<EOL
[selfsigned]
basicConstraints = critical,CA:FALSE
keyUsage = critical, digitalSignature, keyEncipherment
extendedKeyUsage=codeSigning
subjectKeyIdentifier=hash
EOL
openssl x509 -req -days 3560 -in "${selfsigned}.csr" -signkey "${selfsigned}.key" -sha256 \
-out "${selfsigned}.crt" -extfile "${selfsigned}.cnf" -extensions selfsigned
rm "${selfsigned}.cnf" "${selfsigned}.csr"
done