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

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

There is a newer version: 1.78.1
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