Algorithm
The algorithm used to create the hash of the canonical request
struct Algorithm
The algorithm used to create the hash of the canonical request
struct Algorithm
import SotoSignerV4
struct AWSSigner
Amazon Web Services V4 Signer
init(credentials: Credential, name: String, region: String)
Initialise the Signer class with AWS credentials
init(credentials: Credential, name: String, region: String, algorithm: Algorithm)
Initialise the Signer class with AWS credentials
let algorithm: Algorithm
Signing algorithm
let credentials: Credential
Security credentials for accessing AWS services
let name: String
Service signing name. In general this is the same as the service name
let region: String
AWS region you are working in
func processURL(url: URL) -> URL?
Process URL before signing
func signChunk(body: BodyData, signingData: ChunkedSigningData) -> ChunkedSigningData
Generate the signature for a chunk in a s3 chunked upload
func signHeaders(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: BodyData? = nil, omitSecurityToken: Bool = false, date: Date = Date()) -> HTTPHeaders
Generate signed headers, for an HTTP request using the AWS sigV4 algorithm.
func signURL(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: BodyData? = nil, expires: TimeAmount, omitSecurityToken: Bool = false, date: Date = Date()) -> URL
Generate a signed URL, for a HTTP request
func startSigningChunks(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), date: Date = Date()) -> (headers: HTTPHeaders, signingData: ChunkedSigningData)
Start the process of signing a s3 chunked upload.
func startSigningChunks(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), date: Date = Date(), algorithm: Algorithm) -> (headers: HTTPHeaders, signingData: ChunkedSigningData)
Start the process of signing a s3 chunked upload.
enum BodyData
Enum for holding request payload
struct ChunkedSigningData
Temporary structure passed from calls to startSigningChunks
and subsequent calls to signChunk
protocol Sendable
static let sigV4: AWSSigner.Algorithm
Use AWS4-HMAC-SHA256
to specify the HMAC-SHA256
hash algorithm
static let sigV4a: AWSSigner.Algorithm
Use AWS4-ECDSA-P256-SHA256
to specify the ECDSA-P256-SHA-256
hash algorithm