Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2013-2015 Sierra Wireless and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 and Eclipse Distribution License v1.0 which accompany this distribution. The Eclipse Public License is available at and the Eclipse Distribution License is available at Contributors: Sierra Wireless - initial API and implementation /
The security info for a client.

The following security modes are supported:

  • Pre-Shared Key: an identity and a key are needed
  • Raw Public Key Certificate: a public key is needed
public class SecurityInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    // the client end-point
    private final String endpoint;
    // PSK
    private final String identity;
    private final byte[] preSharedKey;
    private final PublicKey rawPublicKey;
    private SecurityInfo(String endpointString identitybyte[] preSharedKeyPublicKey rawPublicKey) {
        this. = endpoint;
        this. = identity;
        this. = preSharedKey;
        this. = rawPublicKey;

Construct a SecurityInfo when using DTLS with Pre-Shared Keys.
    public static SecurityInfo newPreSharedKeyInfo(String endpointString identitybyte[] preSharedKey) {
        return new SecurityInfo(endpointidentitypreSharedKeynull);

Construct a SecurityInfo when using DTLS with Raw Public Key (RPK).
    public static SecurityInfo newRawPublicKeyInfo(String endpointPublicKey rawPublicKey) {
        return new SecurityInfo(endpointnullnullrawPublicKey);
    public String getEndpoint() {
        return ;
    public String getIdentity() {
        return ;
    public byte[] getPreSharedKey() {
        return ;
    public PublicKey getRawPublicKey() {
        return ;
New to GrepCode? Check out our FAQ X