diff --git a/src/rsa/import_key.ts b/src/rsa/import_key.ts index 2881137..c6214be 100644 --- a/src/rsa/import_key.ts +++ b/src/rsa/import_key.ts @@ -57,7 +57,7 @@ function rsa_import_jwk(key: JSONWebKey): RSAKey { * @param key */ function rsa_import_pem_cert(key: string): RSAKey { - const trimmedKey = key.substr(27, key.length - 52); + const trimmedKey = key.substr(27, key.length - 53); const parseKey = ber_simple( ber_decode(base64_to_binary(trimmedKey)), ) as RSACertKeyFormat;