mirror of
https://git.proxmox.com/git/proxmox-acme
synced 2025-04-28 12:16:51 +00:00
proxmox-acme: add _isRSA and _isEcc helpers
the _isRSA one is used by the new yc plugin, but doesn't hurt much to already include the very similar Ecc one too. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
da4c6a7fc1
commit
9fe5356aed
@ -649,6 +649,24 @@ _stat() {
|
||||
stat -c '%U:%G' "$1" 2>/dev/null
|
||||
}
|
||||
|
||||
#keyfile
|
||||
_isRSA() {
|
||||
keyfile=$1
|
||||
if grep "BEGIN RSA PRIVATE KEY" "$keyfile" >/dev/null 2>&1 || ${ACME_OPENSSL_BIN:-openssl} rsa -in "$keyfile" -noout -text | grep "^publicExponent:" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
#keyfile
|
||||
_isEcc() {
|
||||
keyfile=$1
|
||||
if grep "BEGIN EC PRIVATE KEY" "$keyfile" >/dev/null 2>&1 || ${ACME_OPENSSL_BIN:-openssl} ec -in "$keyfile" -noout -text 2>/dev/null | grep "^NIST CURVE:" >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
_time() {
|
||||
date -u "+%s"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user