All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.tls.BasicTlsPSKExternal Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for the TLS, including a JSSE provider. The APIs are designed primarily to be used in conjunction with the BC LTS provider but may also be used with other providers providing cryptographic services.

There is a newer version: 2.73.7
Show newest version
package org.bouncycastle.tls;

import org.bouncycastle.tls.crypto.TlsSecret;
import org.bouncycastle.util.Arrays;

public class BasicTlsPSKExternal
    implements TlsPSKExternal
{
    protected final byte[] identity;
    protected final TlsSecret key;
    protected final int prfAlgorithm; 

    public BasicTlsPSKExternal(byte[] identity, TlsSecret key)
    {
        this(identity, key, PRFAlgorithm.tls13_hkdf_sha256);
    }

    public BasicTlsPSKExternal(byte[] identity, TlsSecret key, int prfAlgorithm)
    {
        this.identity = Arrays.clone(identity);
        this.key = key;
        this.prfAlgorithm = prfAlgorithm;
    }

    public byte[] getIdentity()
    {
        return identity;
    }

    public TlsSecret getKey()
    {
        return key;
    }

    public int getPRFAlgorithm()
    {
        return prfAlgorithm;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy