mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-26 22:02:31 +02:00
Script for generating self-signed certificate
Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
This commit is contained in:
parent
73f10810c0
commit
323d81777d
29
examples/ima-genkey-self.sh
Executable file
29
examples/ima-genkey-self.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
GENKEY=x509_evm.genkey
|
||||
|
||||
cat << __EOF__ >$GENKEY
|
||||
[ req ]
|
||||
default_bits = 1024
|
||||
distinguished_name = req_distinguished_name
|
||||
prompt = no
|
||||
string_mask = utf8only
|
||||
x509_extensions = myexts
|
||||
|
||||
[ req_distinguished_name ]
|
||||
O = `hostname`
|
||||
CN = `whoami` signing key
|
||||
emailAddress = `whoami`@`hostname`
|
||||
|
||||
[ myexts ]
|
||||
basicConstraints=critical,CA:FALSE
|
||||
keyUsage=digitalSignature
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid
|
||||
__EOF__
|
||||
|
||||
openssl req -x509 -new -nodes -utf8 -sha1 -days 3650 -batch -config $GENKEY \
|
||||
-outform DER -out x509_evm.der -keyout privkey_evm.pem
|
||||
|
||||
openssl rsa -pubout -in privkey_evm.pem -out pubkey_evm.pem
|
||||
|
Loading…
x
Reference in New Issue
Block a user