capacitor-shamir
Version:
Provides Shamir's Secret Sharing (SSS) functionality for secure splitting and recovering secrets natively on iOS, Android, and Web.
302 lines • 11.6 kB
JSON
{
"api": {
"name": "ShamirPlugin",
"slug": "shamirplugin",
"docs": "",
"tags": [],
"methods": [
{
"name": "generateShards",
"signature": "(options: { totalShards: number; threshold: number; inputDataBase64: string; }, callback: (data?: { progress: number; shardsBase64?: string[] | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "totalShards (≤255), threshold (≥2, ≤255), and inputDataBase64 (Base64-encoded secret)",
"type": "{ totalShards: number; threshold: number; inputDataBase64: string; }"
},
{
"name": "callback",
"docs": "Reports progress and returns shards as Base64 strings",
"type": "(data?: { progress: number; shardsBase64?: string[] | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options totalShards (≤255), threshold (≥2, ≤255), and inputDataBase64 (Base64-encoded secret)"
},
{
"name": "param",
"text": "callback Reports progress and returns shards as Base64 strings"
}
],
"docs": "Splits secret data (Base64) into encrypted shards in memory.",
"complexTypes": [
"Error"
],
"slug": "generateshards"
},
{
"name": "restoreFromShards",
"signature": "(options: { inputShardsBase64: string[]; }, callback: (data?: { progress: number; dataBase64?: string | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "inputShardsBase64: array of Base64-encoded shards",
"type": "{ inputShardsBase64: string[]; }"
},
{
"name": "callback",
"docs": "Reports progress and returns restored secret as Base64",
"type": "(data?: { progress: number; dataBase64?: string | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options inputShardsBase64: array of Base64-encoded shards"
},
{
"name": "param",
"text": "callback Reports progress and returns restored secret as Base64"
}
],
"docs": "Restores secret data from encrypted shards (all in memory, Base64).",
"complexTypes": [
"Error"
],
"slug": "restorefromshards"
},
{
"name": "restoreShard",
"signature": "(options: { shardIndex: number; inputShardsBase64: string[]; }, callback: (data?: { progress: number; dataBase64?: string | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "shardIndex (>0, ≤255) and inputShardsBase64",
"type": "{ shardIndex: number; inputShardsBase64: string[]; }"
},
{
"name": "callback",
"docs": "Reports progress and returns the requested shard as Base64",
"type": "(data?: { progress: number; dataBase64?: string | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options shardIndex (>0, ≤255) and inputShardsBase64"
},
{
"name": "param",
"text": "callback Reports progress and returns the requested shard as Base64"
}
],
"docs": "Restores a specific shard from a set of encrypted shards (all in memory, Base64).",
"complexTypes": [
"Error"
],
"slug": "restoreshard"
},
{
"name": "generateFileShards",
"signature": "(options: { totalShards: number; threshold: number; srcPath: string; dstPathRoot: string; }, callback: (data?: { progress: number; shardsPaths?: string[] | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "totalShards (≤255), threshold (≥2, ≤255), srcPath (input file), dstPathRoot (output directory)",
"type": "{ totalShards: number; threshold: number; srcPath: string; dstPathRoot: string; }"
},
{
"name": "callback",
"docs": "Reports progress and returns paths to shard files",
"type": "(data?: { progress: number; shardsPaths?: string[] | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options totalShards (≤255), threshold (≥2, ≤255), srcPath (input file), dstPathRoot (output directory)"
},
{
"name": "param",
"text": "callback Reports progress and returns paths to shard files"
}
],
"docs": "Splits a file into encrypted shard files.",
"complexTypes": [
"Error"
],
"slug": "generatefileshards"
},
{
"name": "generateShardsToFiles",
"signature": "(options: { totalShards: number; threshold: number; inputDataBase64: string; dstPathRoot: string; }, callback: (data?: { progress: number; shardsPaths?: string[] | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "totalShards (≤255), threshold (≥2, ≤255), inputDataBase64, dstPathRoot (output directory)",
"type": "{ totalShards: number; threshold: number; inputDataBase64: string; dstPathRoot: string; }"
},
{
"name": "callback",
"docs": "Reports progress and returns paths to shard files",
"type": "(data?: { progress: number; shardsPaths?: string[] | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options totalShards (≤255), threshold (≥2, ≤255), inputDataBase64, dstPathRoot (output directory)"
},
{
"name": "param",
"text": "callback Reports progress and returns paths to shard files"
}
],
"docs": "Splits secret data (Base64) into encrypted shard files.",
"complexTypes": [
"Error"
],
"slug": "generateshardstofiles"
},
{
"name": "restoreFromFileShards",
"signature": "(options: { shardsPaths: string[]; dstPath: string; }, callback: (data?: { progress: number; dstPath?: string | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "shardsPaths (input files), dstPath (output file)",
"type": "{ shardsPaths: string[]; dstPath: string; }"
},
{
"name": "callback",
"docs": "Reports progress and returns the output file path",
"type": "(data?: { progress: number; dstPath?: string | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options shardsPaths (input files), dstPath (output file)"
},
{
"name": "param",
"text": "callback Reports progress and returns the output file path"
}
],
"docs": "Restores a file from encrypted shard files.",
"complexTypes": [
"Error"
],
"slug": "restorefromfileshards"
},
{
"name": "restoreFromFileShardsToData",
"signature": "(options: { shardsPaths: string[]; }, callback: (data?: { progress: number; dataBase64?: string | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "shardsPaths (input files)",
"type": "{ shardsPaths: string[]; }"
},
{
"name": "callback",
"docs": "Reports progress and returns restored secret as Base64",
"type": "(data?: { progress: number; dataBase64?: string | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options shardsPaths (input files)"
},
{
"name": "param",
"text": "callback Reports progress and returns restored secret as Base64"
}
],
"docs": "Restores secret data (Base64) from encrypted shard files.",
"complexTypes": [
"Error"
],
"slug": "restorefromfileshardstodata"
},
{
"name": "restoreFileShard",
"signature": "(options: { shardIndex: number; shardsPaths: string[]; dstPathRoot: string; }, callback: (data?: { progress: number; shardPath?: string | undefined; } | undefined, error?: Error | undefined) => void) => Promise<void>",
"parameters": [
{
"name": "options",
"docs": "shardIndex (>0, ≤255), shardsPaths (input files), dstPathRoot (output directory)",
"type": "{ shardIndex: number; shardsPaths: string[]; dstPathRoot: string; }"
},
{
"name": "callback",
"docs": "Reports progress and returns the path to the restored shard file",
"type": "(data?: { progress: number; shardPath?: string | undefined; } | undefined, error?: Error | undefined) => void"
}
],
"returns": "Promise<void>",
"tags": [
{
"name": "param",
"text": "options shardIndex (>0, ≤255), shardsPaths (input files), dstPathRoot (output directory)"
},
{
"name": "param",
"text": "callback Reports progress and returns the path to the restored shard file"
}
],
"docs": "Restores a specific shard file from a set of encrypted shard files.",
"complexTypes": [
"Error"
],
"slug": "restorefileshard"
}
],
"properties": []
},
"interfaces": [
{
"name": "Error",
"slug": "error",
"docs": "",
"tags": [],
"methods": [],
"properties": [
{
"name": "name",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string"
},
{
"name": "message",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string"
},
{
"name": "stack",
"tags": [],
"docs": "",
"complexTypes": [],
"type": "string | undefined"
}
]
}
],
"enums": [],
"typeAliases": [],
"pluginConfigs": []
}