public final class PskPublicInformation
extends org.eclipse.californium.elements.util.Bytes
PreSharedKeyIdentity, therefore it's required to
use PskPublicInformation(String, byte[]) to setup a proper name for
such non-compliant peers in the
AdvancedPskStore. During
the lookup of the secret key in the handshake, such a non-compliant identity
is normalized with the identity provided by the store.| Modifier and Type | Field and Description |
|---|---|
static PskPublicInformation |
EMPTY |
| Constructor and Description |
|---|
PskPublicInformation(String publicInfo)
Create PSK public information from string (identity or hint).
|
PskPublicInformation(String publicInfo,
byte[] publicInfoBytes)
Create PSK public information from string and bytes (identity or hint).
|
| Modifier and Type | Method and Description |
|---|---|
static PskPublicInformation |
fromByteArray(byte[] byteArray)
Create public information from received byte array.
|
String |
getPublicInfoAsString()
Get public information as string.
|
boolean |
isCompliantEncoding()
Check, if string is compliant encoded as bytes.
|
void |
normalize(String publicInfo)
Normalize public information.
|
String |
toString() |
public static final PskPublicInformation EMPTY
public PskPublicInformation(String publicInfo)
publicInfo - PSK public information as string. Identity or hint.NullPointerException - if public information is nullIllegalArgumentException - if public information encoded in UTF-8
is larger than MAX_LENGTH.public PskPublicInformation(String publicInfo, byte[] publicInfoBytes)
publicInfo - PSK public information as string. Identity or hint.publicInfoBytes - PSK public information encoded as bytes. Identity
or hint.NullPointerException - if one of the parameters are nullIllegalArgumentException - if public information encoded as bytes
is larger than MAX_LENGTH.public void normalize(String publicInfo)
PreSharedKeyIdentity.publicInfo - PSK public information as string. Identity or hint.NullPointerException - if public information is nullIllegalArgumentException - if public information is empty.AdvancedPskStore.getIdentity(java.net.InetSocketAddress,
org.eclipse.californium.scandium.util.ServerNames)public boolean isCompliantEncoding()
true, if encoding is compliant.public String getPublicInfoAsString()
public String toString()
toString in class org.eclipse.californium.elements.util.Bytespublic static PskPublicInformation fromByteArray(byte[] byteArray)
byteArray - received byte arrayIllegalArgumentException - if public information length is larger
than MAX_LENGTH.Copyright © 2023 Eclipse Foundation. All rights reserved.