# US 2025/0224936 A1 · Securing an application programming interface (“api”) during the build of a software development kit (“sdk”)

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0224936 A1
- Document ID: US20250224936A1
- Status: Published application
- Kind: A1
- Application number: 19/088,020
- Filed: 2025-03-24
- Published: 2025-07-10
- Earliest claimed: 2023-05-10
- Assignees: Snap Inc.
- Applicants: Snap Inc.
- Inventors: Frederik Van Voorden; Aaron Wangugi; Ankit Sultania
- Web page: https://patentgrep.com/patent/US20250224936A1

## CPC

- G06F 8/41: Compilation
- G06F 11/3684: {for test design, e.g. generating new test cases}
- H04L 9/0861: {Generation of secret information including derivation or calculation of cryptographic keys or passwords}
- H04L 9/3247: {involving digital signatures}
- G06F 9/547: {Remote procedure calls [RPC]; Web services}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Described is a technique for securing a private secret key during a software build process for a software development kit (SDK) that includes a code implementation for an application programming interface (API), where the private secret key is for use in signing the payload of an API request for the API. Consistent with examples, a keychain service stores a private secret key. In at least one source code file for a SDK, the source code includes a macro definition, which, upon executing by a compiler, obtains a value for the private secret key. In a programming shell environment, a shell script is executed. Execution of the shell script results in executing a nested script, which queries the keychain service for the private secret key. The shell script then passes the private secret key to a build script of an automated software build tool/system, which injects the private secret key into the source code file at compile time by execution of the macro, resulting in a software product capable of using the private secret key to sign or encrypt the payload of one or more API requests.

## Claims

### Claim 1

A method comprising:
storing a private secret key in a keychain service;
executing a first script that requests the private secret key from the keychain service using an end-user identifier;
receiving the private secret key from the keychain service when the end-user identifier is authorized;
passing the private secret key to a build script; and
compiling source code into an executable file using the private secret key, wherein the executable file uses the private secret key to authenticate API requests.

### Claim 2 (depends on 1)

The method of claim 1, wherein the keychain service is accessible only via a private network and utilizes an access control list to determine authorization of the end-user identifier.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
determining whether the build is a test build or a production build based on a server environment variable; and
requesting a stub value of the private secret key when the build is determined to be a test build.

### Claim 4 (depends on 1)

The method of claim 1, wherein the first script executes in a shell scripting environment and invokes a Python client script to communicate with the keychain service.

### Claim 5 (depends on 1)

The method of claim 1, wherein compiling the source code comprises:
executing a macro definition in the source code at compile time to obtain the private secret key from a build system environment variable.

### Claim 6 (depends on 1)

The method of claim 1, wherein the executable file is limited to accessing the private secret key through a single target source code file to prevent unauthorized usage of the private secret key elsewhere in the executable file.

### Claim 7 (depends on 1)

The method of claim 1, wherein the private secret key is used to digitally sign or encrypt an API payload before transmission to an API server.

### Claim 8

A system comprising:
at least one processor; and
at least one memory storage device storing instructions thereon, which, when executed by the at least one processor, cause the system to perform operations comprising:
storing a private secret key in a keychain service;
executing a first script that requests the private secret key from the keychain service using an end-user identifier;
receiving the private secret key from the keychain service when the end-user identifier is authorized;
passing the private secret key to a build script; and
compiling source code into an executable file using the private secret key, wherein the executable file uses the private secret key to authenticate API requests.

### Claim 9 (depends on 8)

The system of claim 8, wherein the keychain service is accessible only via a private network and utilizes an access control list to determine authorization of the end-user identifier.

### Claim 10 (depends on 8)

The system of claim 8, further comprising:
determining whether the build is a test build or a production build based on a server environment variable; and
requesting a stub value of the private secret key when the build is determined to be a test build.

### Claim 11 (depends on 8)

The system of claim 8, wherein the first script executes in a shell scripting environment and invokes a Python client script to communicate with the keychain service.

### Claim 12 (depends on 8)

The system of claim 8, wherein compiling the source code comprises:
executing a macro definition in the source code at compile time to obtain the private secret key from a build system environment variable.

### Claim 13 (depends on 8)

The system of claim 8, wherein the executable file is limited to accessing the private secret key through a single target source code file to prevent unauthorized usage of the private secret key elsewhere in the executable file.

### Claim 14 (depends on 8)

The system of claim 8, wherein the private secret key is used to digitally sign or encrypt an API payload before transmission to an API server.

### Claim 15

A computer-readable medium storing instructions thereon which, when executed by one or more processors of a computing system, cause the computing system to perform operations comprising:
storing a private secret key in a keychain service;
executing a first script that requests the private secret key from the keychain service using an end-user identifier;
receiving the private secret key from the keychain service when the end-user identifier is authorized;
passing the private secret key to a build script; and
compiling source code into an executable file using the private secret key, wherein the executable file uses the private secret key to authenticate API requests.

### Claim 16 (depends on 15)

The computer-readable medium of claim 15, wherein the keychain service is accessible only via a private network and utilizes an access control list to determine authorization of the end-user identifier.

### Claim 17 (depends on 15)

The computer-readable medium of claim 15, wherein the operations further comprise:
determining whether the build is a test build or a production build based on a server environment variable; and
requesting a stub value of the private secret key when the build is determined to be a test build.

### Claim 18 (depends on 15)

The computer-readable medium of claim 15, wherein the first script executes in a shell scripting environment and invokes a Python client script to communicate with the keychain service.

### Claim 19 (depends on 15)

The computer-readable medium of claim 15, wherein compiling the source code comprises:
executing a macro definition in the source code at compile time to obtain the private secret key from a build system environment variable.

### Claim 20 (depends on 15)

The computer-readable medium of claim 15, wherein the executable file is limited to accessing the private secret key through a single target source code file to prevent unauthorized usage of the private secret key elsewhere in the executable file.
