SQRL-Protocol

Additional

Language
Java
Version
N/A
Created
Jul 15, 2014
Updated
Jan 2, 2018 (Retired)
Owner
Ralf Wondratschek (vRallev)
Contributor
Ralf Wondratschek (vRallev)
1
Activity
Badge
Generate
Download
Source code

Deprecated

This project is not maintained anymore.

SQRL-Protocol

An implementation of the SQRL protocol. This library helps to parse, validate and create SQRL messages.

Download

Download the latest JAR or grab via Gradle or Maven:

dependencies {
    compile 'net.vrallev.sqrl:sqrl-protocol:0.0.2'
}
<dependency>
    <groupId>net.vrallev.sqrl</groupId>
    <artifactId>sqrl-protocol</artifactId>
    <version>0.0.2</version>
</dependency>

Advanced

The library requires to implement the EccProvider25519 interface. You can either implement this interface or use one of my other libraries. The libraries are automatically found in the classpath and you don't need to setup anything else.

Both libraries depend on other code. Please respect the author's licenses!

dependencies {
    compile 'net.vrallev.ecc:ecc-25519-android:1.0.0'   // Android
    compile 'net.vrallev.ecc:ecc-25519-java:1.0.0'      // JVM
}

Usage

The class SqrlProtocol serves as entry point. You may want to take a look at the unit tests.

SqrlClientBody bodyOriginal = SqrlProtocol.instance()
  .authenticate(identity.getMasterKey(), mSiteKey)
        .buildRequest(mSignatureUri);

SqrlClientBody bodyParsed = SqrlProtocol.instance()
        .readSqrlClientBody()
        .from(bodyOriginal.getBodyEncoded())
        .verified();

SqrlServerBody bodyOriginal = SqrlProtocol.instance()
  .answerClient(body, ServerParameter.SQRL_ACCOUNT_CREATION_ALLOWED)
  .withServerFriendlyName("Unit Test")
        .withStoredKeys(user.getServerUnlockKey(), user.getVerifyUnlockKey())
  .create()
  .asSqrlServerBody();

SqrlServerBody bodyParsed = SqrlProtocol.instance()
  .readSqrlServerBody()
  .from(bodyOriginal.getBodyEncoded())
  .parsed();

License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.