@@ -71,45 +71,23 @@ public class DPoP {
7171 /* *
7272 * Generates a new key pair for DPoP if it does not exist. This should be called before making any requests that require a DPoP proof.
7373 *
74- * ```kotlin
75- *
76- * try {
77- * DPoP.generateKeyPair(context)
78- * } catch (exception: DPoPException) {
79- * Log.e(TAG,"Error generating key pair: ${exception.stackTraceToString()}")
80- * }
81- *
82- * ```
83- *
8474 * @param context The application context used to access the keystore.
8575 * @throws DPoPException if there is an error generating the key pair or accessing the keystore.
8676 */
8777 @Throws(DPoPException ::class )
88- public fun generateKeyPair (context : Context ) {
78+ internal fun generateKeyPair (context : Context ) {
8979 DPoPUtil .generateKeyPair(context)
9080 }
9181
9282 /* *
9383 * Method to get the public key in JWK format. This is used to generate the `jwk` field in the DPoP proof header.
9484 * This method will also create a key-pair in the key store if one currently doesn't exist.
9585 *
96- * ```kotlin
97- *
98- * try {
99- * val dPoP = DPoP()
100- * val publicKeyJWK = dPoP.getPublicKeyJWK(context)
101- * Log.d(TAG, "Public Key JWK: $publicKeyJWK")
102- * } catch (exception: DPoPException) {
103- * Log.e(TAG,"Error getting public key JWK: ${exception.stackTraceToString()}")
104- * }
105- *
106- * ```
107- *
10886 * @return The public key in JWK format or null if the key pair is not present.
10987 * @throws DPoPException if there is an error accessing the key pair.
11088 */
11189 @Throws(DPoPException ::class )
112- public fun getPublicKeyJWK (context : Context ): String? {
90+ internal fun getPublicKeyJWK (context : Context ): String? {
11391 generateKeyPair(context)
11492 return DPoPUtil .getPublicKeyJWK()
11593 }
@@ -141,7 +119,7 @@ public class DPoP {
141119 * @param response The HTTP response containing the nonce header.
142120 */
143121 @JvmStatic
144- public fun storeNonce (response : Response ) {
122+ internal fun storeNonce (response : Response ) {
145123 _auth0Nonce = response.headers[NONCE_HEADER ]
146124 }
147125
0 commit comments