public class PublicKeyCredentialSource
extends java.lang.Object
| Constructor and Description |
|---|
PublicKeyCredentialSource(com.yubico.webauthn.data.PublicKeyCredentialType type,
COSE.OneKey privateKey,
java.lang.String rpId,
com.yubico.webauthn.data.ByteArray userHandle)
Public constructor of this data class.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.Optional<PublicKeyCredentialSource> |
deserialize(com.yubico.webauthn.data.ByteArray credentialId)
Deserialize the given byte array to reconstruct the credential source it represents.
|
com.yubico.webauthn.data.ByteArray |
getId()
Returns the credential id if set, otherwise null.
|
COSE.OneKey |
getKey()
See
constructor for a description of this field. |
java.lang.String |
getRpId()
See
constructor for a description of this field. |
com.yubico.webauthn.data.PublicKeyCredentialType |
getType()
See
constructor for a description of this field. |
com.yubico.webauthn.data.ByteArray |
getUserHandle()
See
constructor for a description of this field. |
byte[] |
serialize()
Encodes this credential source to a byte array so it can be encrypted and used as the credential id for
server-side credential storage
|
void |
setId(com.yubico.webauthn.data.ByteArray id)
Set the credential ID, for example to the
serialized version of this credential source itself
for server-side credentials or a randomly generated byte array for client-side discoverable credentials. |
java.lang.String |
toString() |
public PublicKeyCredentialSource(com.yubico.webauthn.data.PublicKeyCredentialType type,
COSE.OneKey privateKey,
java.lang.String rpId,
com.yubico.webauthn.data.ByteArray userHandle)
Note that the credential id must be set after creation.
type - Type of credential.privateKey - The private key wrapped as a COSE OneKey.rpId - The relying party identifieruserHandle - The user handle of the user this credential belongs to.public com.yubico.webauthn.data.PublicKeyCredentialType getType()
constructor for a description of this field.public COSE.OneKey getKey()
constructor for a description of this field.public java.lang.String getRpId()
constructor for a description of this field.public com.yubico.webauthn.data.ByteArray getUserHandle()
constructor for a description of this field.public byte[] serialize()
deserialize(ByteArray).deserialize(ByteArray),
Credential IDpublic static java.util.Optional<PublicKeyCredentialSource> deserialize(com.yubico.webauthn.data.ByteArray credentialId)
credentialId - The byte array used as a credential id that encodes the credential source data.public java.lang.String toString()
toString in class java.lang.Objectpublic com.yubico.webauthn.data.ByteArray getId()
public void setId(com.yubico.webauthn.data.ByteArray id)
serialized version of this credential source itself
for server-side credentials or a randomly generated byte array for client-side discoverable credentials.id - The id to set.