Search in sources :

Example 1 with PermissionObject

use of me.retrodaredevil.solarthing.type.closed.authorization.PermissionObject in project solarthing by wildmountainfarms.

the class DatabaseDocumentKeyMap method getKey.

@Override
public PublicKey getKey(String sender) {
    AuthorizationPacket authorizationPacket = packetCache.getPacket();
    if (authorizationPacket == null) {
        LOGGER.debug("authorizationPacket is null");
        return null;
    }
    PermissionObject permissionObject = authorizationPacket.getSenderPermissions().get(sender);
    if (permissionObject == null) {
        LOGGER.info("No permission object for sender: " + sender);
        return null;
    }
    // we may use more of permission object in the future
    return permissionObject.getPublicKeyObject();
}
Also used : AuthorizationPacket(me.retrodaredevil.solarthing.type.closed.authorization.AuthorizationPacket) PermissionObject(me.retrodaredevil.solarthing.type.closed.authorization.PermissionObject)

Aggregations

AuthorizationPacket (me.retrodaredevil.solarthing.type.closed.authorization.AuthorizationPacket)1 PermissionObject (me.retrodaredevil.solarthing.type.closed.authorization.PermissionObject)1