approve abstract method

Future<AtEnrollmentResponse> approve(
  1. EnrollmentRequestDecision enrollmentRequestDecision,
  2. AtLookUp atLookUp, {
  3. required ApproverKeyMaterial approverKeys,
})

Approves an enrollment request.

Accepts EnrollmentRequestDecision which encapsulates the necessary enrollment request details for approving the enrollment request.

To approve the request, the "enrollmentId" and its corresponding "encryptedAPKAMSymmetricKey," received through the notification, must be provided using the "AuthenticationRequestDecisionBuilder."

Upon approval, the encryptedAPKAMSymmetricKey undergoes decryption using the default encryption public key to retrieve the original APKAM Symmetric key. Subsequently, the default encryption key pair and the self-encryption key are encrypted with the APKAM symmetric key and transmitted to the server.

The atLookUp parameter is used to perform lookups during approval management.

Returns a Future containing an AtEnrollmentResponse representing the result of the approval/denial of an enrollment.

 To approve an enrollment request

AtEnrollmentBase atEnrollmentBase = AtEnrollmentImpl('@alice');
// lookUps: the application's AtLookUpFactory, such as secureSocketLookUps()
final atLookup = lookUps(
  atSign: '@alice',
  rootDomain: AtRootDomain.atsignDomain,
  authenticator: authenticatorFor(keysIo, '@alice'),
);

EnrollmentRequestDecision enrollmentRequestDecision =
          EnrollmentRequestDecision.approved(ApprovedRequestDecisionBuilder(
              enrollmentId: 'dummy-enrollment-id',
              encryptedAPKAMSymmetricKey: 'dummy-encrypted-apkam-symmetric-key'));

AtEnrollmentResponse atEnrollmentResponse = await atEnrollmentBase.approve(
      enrollmentRequestDecision, atLookupImpl, approverKeys: myKeys);

approverKeys is what approval reads of the approving client's own material, and all of it: the atSign's encryption private key, which unwraps the symmetric key a legacy enrollee RSA-wrapped to it, and its self-encryption key, one of the two secrets sealed for the enrollee. Neither is authentication, so the caller hands them over rather than the implementation reaching through atLookUp for them.

Implementation

Future<AtEnrollmentResponse> approve(
    EnrollmentRequestDecision enrollmentRequestDecision, AtLookUp atLookUp,
    {required ApproverKeyMaterial approverKeys});