Class ApplePrivateKeyParser
java.lang.Object
com.irurueta.authserver.authorization.api.web.social.ApplePrivateKeyParser
Reads the private key Apple issues for Sign in with Apple (an EC P-256 key in PKCS#8 PEM form, the content of the
.p8 file) from the text an environment variable holds, where line breaks are often written as a literal
\n. The error never repeats the key.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intBits of the order of the P-256 curve Apple's ES256 keys use. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
P256_ORDER_BITS
static final int P256_ORDER_BITSBits of the order of the P-256 curve Apple's ES256 keys use.- See Also:
-
-
Constructor Details
-
ApplePrivateKeyParser
public ApplePrivateKeyParser()
-
-
Method Details
-
parse
Parses a key.- Parameters:
pem- PKCS#8 PEM text of the key, with or without the header and footer lines.- Returns:
- the private key.
- Throws:
IllegalArgumentException- if the text is not a PKCS#8 EC P-256 private key.
-
notAKey
Builds the message of a refused key.- Returns:
- the message.
-