I am writing a client for Account Key Roll-over. I followed this docs https://ietf-wg-acme.github.io/acme/draft-ietf-acme-acme.html#rfc.section.7.3.6 and this one https://tools.ietf.org/html/draft-ietf-acme-acme-06#section-7.3.3
I am posting the following data to /acme/key-change
{"header":{"alg":"RS256","kid":"https:\/\/acme-v01.api.letsencrypt.org\/acme\/reg\/21941027","jwk":{"kty":"RSA","n":"smmXFfmi_e2vb1QKC9LTFEsYwbKT2csLPENgqTREEqGpQ90117TJyYFA3n6qWwl9PDfG6y4AYhs38PA4DE5dKXiwmiyWua6a7r9-iOz9F1EvckuNSU_OFYcSJvT9WTwDfWydoJBYKOhDl0ev_Jr9UWKGfWdUN_sy1sKV6skymq0DO1_6sIcE7uPiH06PPt28_5YPumTYhK8LX9_pMTJy5gkfgYa3Lty8AecZSBY2hJ4TbmQ5hRq7WZnm5xEnukemGHPDSC_E4zrDB0hZDVNP2okxxWGLlD1nwoO3opL3IxLF7EUyqRO4bwJr5wmkHdiswZBIoJxEKXujIlcNScjjmJLPgc8Z8tC3d9SJ1i_VJssXK3yqQYK1Wfnka5yLm0R-N5l-hgrvES_ZfAvUi4jvj4Q-AUJb0r-pepzw6hRZdVldIUT5NpobfBkuw6jgtlPNSK4JpXckrVpZXVrs4zNFg_wn7MdECtimDB2Kk6681swSoPuNx76D_Jx8q86h6CbwVvESTslB0eHTEMlG9MyGbrdjHHD69pAAVoRMwHEtDlj3tta_u0-rYt_BgNsM6fM_oNcfEx-RufF83ZeTe9cvF5yXZr1Egx7srH0SOSzgb6A1lTyEAJuhQBRnbWHw1xbzloRFZmkxbCra2o4XYkl0RaOX4I_4G80_TarBUBEh_3k","e":"AQAB"}},"protected":"eyJhbGciOiJSUzI1NiIsImtpZCI6Imh0dHBzOlwvXC9hY21lLXYwMS5hcGkubGV0c2VuY3J5cHQub3JnXC9hY21lXC9yZWdcLzIxOTQxMDI3IiwiandrIjp7Imt0eSI6IlJTQSIsIm4iOiJzbW1YRmZtaV9lMnZiMVFLQzlMVEZFc1l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74lgYPvgk6FJEBJiSDS-KCMDPRD0LKiWbuU9zvvMaz9KIbrm6cNdNUsZz3YkRj_fQbqj1t7kSbYjJFnpqZTE-cKfBfWneiYNq-qRBjInPtfothEPkC7lbrUd7Knj5AVMbU5be-gQrX13Ds21ld0s1GrglWx2LTv3fEV8ObNr1IICb0fKhUGfB8ELUwWLx4ukehciFKxTFc6z-7P5Hvq1-BcgCwhZiI1ICyJZHbeJO2eWgUS3gUhndv8luP9fjUqepzWHF0xG-gzLE0OQi9k5qPFgcU"}
And getting following responce:
Array
(
[type] => urn:acme:error:malformed
[detail] => Parse error reading JWS
[status] => 400
)
I am providing exact same value (JWK representation of new private key) for “newKey” and “jwk” of the inner JWS. The inner JWS is signed by new key and outer JWS is signed by the existing (or if we call it old) key.
Can’t find out where I am doing wrong. Please help.
Thank you.