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

org.bouncycastle.tls.BasicTlsSRPIdentity 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.util.Arrays;
import org.bouncycastle.util.Strings;

/**
 * A basic SRP Identity holder.
 */
public class BasicTlsSRPIdentity
    implements TlsSRPIdentity
{
    protected byte[] identity;
    protected byte[] password;

    public BasicTlsSRPIdentity(byte[] identity, byte[] password)
    {
        this.identity = Arrays.clone(identity);
        this.password = Arrays.clone(password);
    }

    public BasicTlsSRPIdentity(String identity, String password)
    {
        this.identity = Strings.toUTF8ByteArray(identity);
        this.password = Strings.toUTF8ByteArray(password);
    }

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

    public byte[] getSRPPassword()
    {
        return password;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy