Class OwlServerRegistration
java.lang.Object
org.bouncycastle.crypto.agreement.owl.OwlServerRegistration
A server in the Owl key exchange protocol specifically for the user registration phase.
See OwlClientRegistration for 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 OwlServerRegistration and OwlClientRegistration should be constructed for each new Owl exchange).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final boolean -
Constructor Summary
ConstructorsConstructorDescriptionOwlServerRegistration(String serverId) Convenience constructor for a newOwlServerRegistrationthat uses theOwlCurves.NIST_P256elliptic curve, a SHA-256 digest, and a defaultSecureRandomimplementation.OwlServerRegistration(String serverId, OwlCurve curve) Convenience constructor for a newOwlServerRegistrationthat uses a SHA-256 digest and a defaultSecureRandomimplementation.OwlServerRegistration(String serverId, OwlCurve curve, Digest digest, SecureRandom random) Construct a newOwlServerRegistration. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck's the status of the user registration I.E. whether or not this server has registered a user already.registerUseronServer(OwlInitialRegistration userLoginRegistrationReceived) Receives the payload sent by the client as part of user registration, and stores necessary values in the server.
-
Field Details
-
REGISTRATION_NOT_CALLED
public static final boolean REGISTRATION_NOT_CALLED- See Also:
-
REGISTRATION_CALLED
public static final boolean REGISTRATION_CALLED- See Also:
-
-
Constructor Details
-
OwlServerRegistration
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:
NullPointerException- if any argument is null
-
OwlServerRegistration
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:
NullPointerException- if any argument is null
-
OwlServerRegistration
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:
NullPointerException- if any argument is null
-
-
Method Details
-
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:
IllegalStateException- if this functions is called more than once.CryptoException- if validation of the payload fails
-