public byte[] generatePremasterSecret() throws IOException { try { // TODO Check if this needs to be a fixed size return BigIntegers.asUnsignedByteArray(srpClient.calculateSecret(B)); } catch (CryptoException e) { handler.failWithError(TlsProtocolHandler.AL_fatal, TlsProtocolHandler.AP_illegal_parameter); return null; // Unreachable! } }
public byte[] generateClientKeyExchange() throws IOException { return BigIntegers.asUnsignedByteArray(srpClient.generateClientCredentials(s, this.SRP_identity, this.SRP_password)); }
public void init(SRP6GroupParameters group, Digest digest, SecureRandom random) { init(group.getN(), group.getG(), digest, random); }
public TlsSRPKeyExchange(int keyExchange, Vector supportedSignatureAlgorithms, TlsSRPGroupVerifier groupVerifier, byte[] identity, byte[] password) { super(keyExchange, supportedSignatureAlgorithms); this.tlsSigner = createSigner(keyExchange); this.groupVerifier = groupVerifier; this.identity = identity; this.password = password; this.srpClient = new SRP6Client(); }
/** * Generates the secret S given the server's credentials * @param serverB The server's credentials * @return Client's verification message for the server * @throws CryptoException If server's credentials are invalid */ public BigInteger calculateSecret(BigInteger serverB) throws CryptoException { this.B = SRP6Util.validatePublicValue(N, serverB); this.u = SRP6Util.calculateU(digest, N, A, B); this.S = calculateS(); return S; }
/** * Generates client's credentials given the client's salt, identity and password * @param salt The salt used in the client's verifier. * @param identity The user's identity (eg. username) * @param password The user's password * @return Client's public value to send to server */ public BigInteger generateClientCredentials(byte[] salt, byte[] identity, byte[] password) { this.x = SRP6Util.calculateX(digest, N, salt, identity, password); this.a = selectPrivateValue(); this.A = g.modPow(a, N); return A; }
public TlsSRPKeyExchange(int keyExchange, Vector supportedSignatureAlgorithms, TlsSRPGroupVerifier groupVerifier, byte[] identity, byte[] password) { super(keyExchange, supportedSignatureAlgorithms); this.tlsSigner = createSigner(keyExchange); this.groupVerifier = groupVerifier; this.identity = identity; this.password = password; this.srpClient = new SRP6Client(); }
/** * Generates the secret S given the server's credentials * @param serverB The server's credentials * @return Client's verification message for the server * @throws CryptoException If server's credentials are invalid */ public BigInteger calculateSecret(BigInteger serverB) throws CryptoException { this.B = SRP6Util.validatePublicValue(N, serverB); this.u = SRP6Util.calculateU(digest, N, A, B); this.S = calculateS(); return S; }
/** * Generates client's credentials given the client's salt, identity and password * @param salt The salt used in the client's verifier. * @param identity The user's identity (eg. username) * @param password The user's password * @return Client's public value to send to server */ public BigInteger generateClientCredentials(byte[] salt, byte[] identity, byte[] password) { this.x = SRP6Util.calculateX(digest, N, salt, identity, password); this.a = selectPrivateValue(); this.A = g.modPow(a, N); return A; }
public void init(SRP6GroupParameters group, Digest digest, SecureRandom random) { init(group.getN(), group.getG(), digest, random); }
public byte[] generateClientKeyExchange() throws IOException { return BigIntegers.asUnsignedByteArray(srpClient.generateClientCredentials(s, this.SRP_identity, this.SRP_password)); }
public byte[] generatePremasterSecret() throws IOException { try { // TODO Check if this needs to be a fixed size return BigIntegers.asUnsignedByteArray(srpClient.calculateSecret(B)); } catch (CryptoException e) { handler.failWithError(TlsProtocolHandler.AL_fatal, TlsProtocolHandler.AP_illegal_parameter); return null; // Unreachable! } }
this.srpClient.init(N, g, new SHA1Digest(), handler.getRandom());
public byte[] generateClientKeyExchange() throws IOException { return BigIntegers.asUnsignedByteArray(srpClient.generateClientCredentials(s, this.SRP_identity, this.SRP_password)); }
public byte[] generatePremasterSecret() throws IOException { try { // TODO Check if this needs to be a fixed size return BigIntegers.asUnsignedByteArray(srpClient.calculateSecret(B)); } catch (CryptoException e) { handler.failWithError(TlsProtocolHandler.AL_fatal, TlsProtocolHandler.AP_illegal_parameter); return null; // Unreachable! } }
this.srpClient.init(N, g, new SHA1Digest(), handler.getRandom());
public void generateClientKeyExchange(OutputStream output) throws IOException { BigInteger A = srpClient.generateClientCredentials(srpSalt, identity, password); TlsSRPUtils.writeSRPParameter(A, output); context.getSecurityParameters().srpIdentity = Arrays.clone(identity); }
public byte[] generatePremasterSecret() throws IOException { try { BigInteger S = srpServer != null ? srpServer.calculateSecret(srpPeerCredentials) : srpClient.calculateSecret(srpPeerCredentials); // TODO Check if this needs to be a fixed size return BigIntegers.asUnsignedByteArray(S); } catch (CryptoException e) { throw new TlsFatalAlert(AlertDescription.illegal_parameter, e); } }
this.srpClient.init(N, g, new SHA1Digest(), handler.getRandom());
public void generateClientKeyExchange(OutputStream output) throws IOException { BigInteger A = srpClient.generateClientCredentials(srpSalt, identity, password); TlsSRPUtils.writeSRPParameter(A, output); context.getSecurityParameters().srpIdentity = Arrays.clone(identity); }