Class OwlServerRegistration
- java.lang.Object
-
- org.bouncycastle.crypto.agreement.owl.OwlServerRegistration
-
public class OwlServerRegistration extends java.lang.ObjectA server in the Owl key exchange protocol specifically for the user registration phase.See
OwlClientRegistrationfor more details on the user registration in Owl.This class is stateful and NOT threadsafe. Each instance should only be used for ONE complete Owl registration phase (i.e. a new
OwlServerRegistrationandOwlClientRegistrationshould be constructed for each new Owl exchange).
-
-
Field Summary
Fields Modifier and Type Field Description static booleanREGISTRATION_CALLEDstatic booleanREGISTRATION_NOT_CALLED
-
Constructor Summary
Constructors Constructor Description OwlServerRegistration(java.lang.String serverId)Convenience constructor for a newOwlServerRegistrationthat uses theOwlCurves.NIST_P256elliptic curve, a SHA-256 digest, and a defaultSecureRandomimplementation.OwlServerRegistration(java.lang.String serverId, OwlCurve curve)Convenience constructor for a newOwlServerRegistrationthat uses a SHA-256 digest and a defaultSecureRandomimplementation.OwlServerRegistration(java.lang.String serverId, OwlCurve curve, Digest digest, java.security.SecureRandom random)Construct a newOwlServerRegistration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetRegistrationState()Check's the status of the user registration I.E. whether or not this server has registered a user already.OwlFinishRegistrationregisterUseronServer(OwlInitialRegistration userLoginRegistrationReceived)Receives the payload sent by the client as part of user registration, and stores necessary values in the server.
-
-
-
Field Detail
-
REGISTRATION_NOT_CALLED
public static final boolean REGISTRATION_NOT_CALLED
- See Also:
- Constant Field Values
-
REGISTRATION_CALLED
public static final boolean REGISTRATION_CALLED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OwlServerRegistration
public OwlServerRegistration(java.lang.String serverId)
Convenience constructor for a newOwlServerRegistrationthat uses theOwlCurves.NIST_P256elliptic curve, a SHA-256 digest, and a defaultSecureRandomimplementation.After construction, the
registrationStatewill beREGISTRATION_NOT_CALLED.- Parameters:
serverId- unique identifier of this server. The server and client in the exchange must NOT share the same id.- Throws:
java.lang.NullPointerException- if any argument is null
-
OwlServerRegistration
public OwlServerRegistration(java.lang.String serverId, OwlCurve curve)Convenience constructor for a newOwlServerRegistrationthat uses a SHA-256 digest and a defaultSecureRandomimplementation.After construction, the
registrationStatewill beREGISTRATION_NOT_CALLED.- Parameters:
serverId- unique identifier of this server. The server and client in the exchange must NOT share the same id.curve- elliptic curve SeeOwlCurvesfor standard curves.- Throws:
java.lang.NullPointerException- if any argument is null
-
OwlServerRegistration
public OwlServerRegistration(java.lang.String serverId, OwlCurve curve, Digest digest, java.security.SecureRandom random)Construct a newOwlServerRegistration.After construction, the
registrationStatewill beREGISTRATION_NOT_CALLED.- Parameters:
serverId- unique identifier of this server. The client and server in the exchange must NOT share the same id.curve- elliptic curve; seeOwlCurvesfor standard curvesdigest- digest to use during zero knowledge proofs and key confirmation (SHA-256 or stronger preferred)random- source of secure random data for x3 and x4, and for the zero knowledge proofs- Throws:
java.lang.NullPointerException- if any argument is null
-
-
Method Detail
-
getRegistrationState
public boolean getRegistrationState()
Check's the status of the user registration I.E. whether or not this server has registered a user already. See theREGSITRATION_*constants for possible values.- Returns:
- true if the user has been registered or false otherwise
-
registerUseronServer
public OwlFinishRegistration registerUseronServer(OwlInitialRegistration userLoginRegistrationReceived) throws CryptoException
Receives the payload sent by the client as part of user registration, and stores necessary values in the server.Must be called after
OwlClientRegistration.initiateUserRegistration()by theOwlClient.- Parameters:
userLoginRegistrationReceived-OwlInitialRegistration- Returns:
OwlFinishRegistration- Throws:
java.lang.IllegalStateException- if this functions is called more than once.CryptoException- if validation of the payload fails
-
-