The SPKAC ASN.1 description:

PublicKeyAndChallenge ::= SEQUENCE {
    spki SubjectPublicKeyInfo,
    challenge IA5STRING

SignedPublicKeyAndChallenge ::= SEQUENCE {
    publicKeyAndChallenge PublicKeyAndChallenge,
    signatureAlgorithm AlgorithmIdentifier,
    signature BIT STRING

What's the point of the challenge string?

  • I'm not familiar with this protocol, but usually challenge strings prevent replay attacks. – CodesInChaos Dec 16 '12 at 16:03

From the OpenSSL documentation on the subject:

The challenge string permits a primitive form of proof of possession of private key. By checking the SPKAC signature and a random challenge string some guarantee is given that the user knows the private key corresponding to the public key being certified. This is important in some applications. Without this it is possible for a previous SPKAC to be used in a "replay attack".

| improve this answer | |
  • To expand on tylerl's answer the following is a use case. 1. HTML5 KeyGen element generates private key, derives public key, prompts for user challenge and encodes new SPKAC which is sent to server. 2. Server registers challenge, uses SPKAC to generate new CSR. 3. Once CA signs CSR (created from initial SPKAC), the PEM formatted certificate is pushed back to client. 4. Following/subsequent visits to server (when configured to perform 'certificate based authentication') can be used for authentication. This is where a relay may be implemented and the challenge can be used to prevent it. – jas- Mar 31 '14 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.