All Downloads are FREE. Search and download functionalities are using the official Maven repository.

androidMain.aws.sdk.kotlin.crt.auth.credentials.StaticCredentialsProviderJVM.kt Maven / Gradle / Ivy

There is a newer version: 0.8.9
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package aws.sdk.kotlin.crt.auth.credentials
import software.amazon.awssdk.crt.auth.credentials.StaticCredentialsProvider as StaticCredentialsProviderJni

/**
 * A credentials provider for a fixed set of credentials
 */
public actual class StaticCredentialsProvider internal actual constructor(builder: StaticCredentialsProviderBuilder) :
    JniCredentialsProvider(),
    CredentialsProvider {
    public actual companion object {}

    override val jniCredentials = StaticCredentialsProviderJni.StaticCredentialsProviderBuilder().apply {
        // build() requires these be non-null already
        withAccessKeyId(builder.accessKeyId!!.encodeToByteArray())
        withSecretAccessKey(builder.secretAccessKey!!.encodeToByteArray())
        builder.sessionToken?.let {
            withSessionToken(it.encodeToByteArray())
        }
    }.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy