import { GraphClientListener } from "@atomist/automation-client/lib/graph/ApolloGraphClient";
import { HandlerContext } from "@atomist/automation-client/lib/HandlerContext";
import { DeepPartial } from "ts-essentials";
import { SdmGoalEvent } from "../../api/goal/SdmGoalEvent";
import { SdmGoalMessage } from "../../api/goal/SdmGoalMessage";
import { GoalSigningAlgorithm, GoalSigningConfiguration } from "../../api/machine/SigningKeys";
export interface SignatureMixin {
    signature: string;
}
export declare const DefaultGoalSigningAlgorithm: GoalSigningAlgorithm<string>;
/**
 * AutomationEventListener that verifies incoming SDM goals against a set of configurable
 * verification public keys.
 *
 * Optionally a private key can be specified to sign outgoing goals. Setting this is strongly
 * recommended to prevent executing untrusted and/or tampered SDM goals.
 */
export declare class GoalSigningAutomationEventListener implements GraphClientListener {
    private readonly gsc;
    constructor(gsc: GoalSigningConfiguration);
    operationStarting(operation: any): any;
    private initVerificationKeys;
}
/**
 * Verify a goal signature against the public keys configured in provided Configuration.
 * If signature can't be verified, the goal will be marked as failed and an Error will be thrown.
 * @param goal goal to verify
 * @param gsc signing configuration
 * @param ctx
 */
export declare function verifyGoal(goal: SdmGoalEvent & DeepPartial<SignatureMixin>, gsc: GoalSigningConfiguration, ctx: HandlerContext): Promise<void>;
/**
 * Add a signature to a goal
 * @param goal
 * @param gsc
 */
export declare function signGoal(goal: SdmGoalMessage, gsc: GoalSigningConfiguration): SdmGoalMessage & SignatureMixin;
export declare function normalizeGoal(goal: SdmGoalMessage | SdmGoalEvent): string;
//# sourceMappingURL=goalSigning.d.ts.map