You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
968 B
43 lines
968 B
using System;
|
|
|
|
using Org.BouncyCastle.Utilities;
|
|
|
|
namespace Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
public class BasicTlsPskIdentity
|
|
: TlsPskIdentity
|
|
{
|
|
protected byte[] mIdentity;
|
|
protected byte[] mPsk;
|
|
|
|
public BasicTlsPskIdentity(byte[] identity, byte[] psk)
|
|
{
|
|
this.mIdentity = Arrays.Clone(identity);
|
|
this.mPsk = Arrays.Clone(psk);
|
|
}
|
|
|
|
public BasicTlsPskIdentity(string identity, byte[] psk)
|
|
{
|
|
this.mIdentity = Strings.ToUtf8ByteArray(identity);
|
|
this.mPsk = Arrays.Clone(psk);
|
|
}
|
|
|
|
public virtual void SkipIdentityHint()
|
|
{
|
|
}
|
|
|
|
public virtual void NotifyIdentityHint(byte[] psk_identity_hint)
|
|
{
|
|
}
|
|
|
|
public virtual byte[] GetPskIdentity()
|
|
{
|
|
return mIdentity;
|
|
}
|
|
|
|
public virtual byte[] GetPsk()
|
|
{
|
|
return Arrays.Clone(mPsk);
|
|
}
|
|
}
|
|
}
|
|
|