WebAuthn has some custom logic to account for backward compatibility on the deserialization of stored public keys in older formats. See this comment.
Up until now, this logic is was not properly encapsulated so that it could be reused from other parts of the gem, or even to be used as a public API.
Motivated by https://github.com/cedarcode/webauthn-ruby/issues/222 and in collaboration with @padulafacundo a new method is now exposed to be able to check that a stored public key abides by the expected formatting.
If WebAuthn::PublicKey.deserialize(stored_public_key) succeeds, then a user can be sure the key is valid.
WebAuthn has some custom logic to account for backward compatibility on the deserialization of stored public keys in older formats. See this comment.
Up until now, this logic is was not properly encapsulated so that it could be reused from other parts of the gem, or even to be used as a public API.
Motivated by https://github.com/cedarcode/webauthn-ruby/issues/222 and in collaboration with @padulafacundo a new method is now exposed to be able to check that a stored public key abides by the expected formatting. If
WebAuthn::PublicKey.deserialize(stored_public_key)
succeeds, then a user can be sure the key is valid.