/**
 * Signature Service - ECDSA Digital Signatures
 *
 * Handles signing and verification of messages using ECDSA secp256k1.
 * Used for authenticating requests and proving identity ownership.
 */
export interface SignedMessage {
    message: string;
    signature: string;
    publicKey: string;
    timestamp: number;
}
export interface AuthChallenge {
    challenge: string;
    publicKey: string;
    timestamp: number;
}
export declare class SignatureService {
    /**
     * Generate a random challenge string (for offline use)
     * Uses expo-crypto in React Native, crypto.randomBytes in Node.js
     */
    static generateChallenge(): Promise<string>;
    /**
     * Hash a message using SHA-256
     */
    static hashMessage(message: string): Promise<string>;
    /**
     * Sign a message using the stored private key
     * Returns the signature in DER format (hex encoded)
     */
    static sign(message: string): Promise<string>;
    /**
     * Sign a message with an explicit private key (without storing)
     * Useful for one-time operations or testing
     */
    static signWithKey(message: string, privateKey: string): Promise<string>;
    /**
     * Verify a signature against a message and public key
     */
    static verify(message: string, signature: string, publicKey: string): Promise<boolean>;
    /**
     * Synchronous verification (for Node.js backend)
     * Uses crypto module directly for hashing
     * Note: This method should only be used in Node.js environments
     */
    static verifySync(message: string, signature: string, publicKey: string): boolean;
    /**
     * Create a signed message object with metadata
     */
    static createSignedMessage(message: string): Promise<SignedMessage>;
    /**
     * Verify a signed message object
     * Checks both signature validity and timestamp freshness
     */
    static verifySignedMessage(signedMessage: SignedMessage, maxAgeMs?: number): Promise<boolean>;
    /**
     * Create a signed authentication challenge response
     * Used for challenge-response authentication
     */
    static signChallenge(challenge: string): Promise<AuthChallenge>;
    /**
     * Verify a challenge response
     */
    static verifyChallengeResponse(originalChallenge: string, response: AuthChallenge, maxAgeMs?: number): Promise<boolean>;
    /**
     * Create a registration signature
     * Used when registering a new identity with the server
     * Format matches server expectation: oxy:register:{publicKey}:{timestamp}
     */
    static createRegistrationSignature(): Promise<{
        signature: string;
        publicKey: string;
        timestamp: number;
    }>;
    /**
     * Sign arbitrary data for API requests
     * Creates a canonical string representation and signs it
     */
    static signRequestData(data: Record<string, unknown>): Promise<{
        signature: string;
        publicKey: string;
        timestamp: number;
    }>;
}
export default SignatureService;
//# sourceMappingURL=signatureService.d.ts.map