Class KinesisVideoCredentials

  • All Implemented Interfaces:
    Serializable

    @Immutable
    @ThreadSafe
    public class KinesisVideoCredentials
    extends Object
    implements Serializable
    Credentials object containing AWS credentials. They might be temporary (using a session token). Consumer is responsible for checking the expiration before using the credentials.

    If the credentials are non-temporary, the session token will be null and the expiration will be getCredentialsNeverExpire().

    See Also:
    Serialized Form
    • Field Detail

      • CREDENTIALS_NEVER_EXPIRE

        @Deprecated
        public static final Date CREDENTIALS_NEVER_EXPIRE
        Deprecated.
        This exposes a mutable Date object. Use getCredentialsNeverExpire() instead.
        Sentinel value indicating the credentials never expire.
    • Constructor Detail

      • KinesisVideoCredentials

        public KinesisVideoCredentials​(@Nonnull
                                       String accessKey,
                                       @Nonnull
                                       String secretKey)
        Constructor for non-temporary credentials.
        Parameters:
        accessKey - AWS Access Key ID, must not be null or empty
        secretKey - AWS Secret Key, must not be null or empty
        Throws:
        IllegalArgumentException - if accessKey or secretKey is null or empty
      • KinesisVideoCredentials

        public KinesisVideoCredentials​(@Nonnull
                                       String accessKey,
                                       @Nonnull
                                       String secretKey,
                                       @Nullable
                                       String sessionToken,
                                       @Nonnull
                                       Date expiration)
        Constructor for temporary credentials.
        Parameters:
        accessKey - AWS Access Key ID, must not be null or empty
        secretKey - AWS Secret Key, must not be null or empty
        sessionToken - AWS Session Token, must not be empty if provided
        expiration - When this set of credentials expire, must not be null
        Throws:
        IllegalArgumentException - if accessKey, secretKey, or sessionToken is empty, or if any required parameter is null, or if a session token is provided for non-temporary credentials
    • Method Detail

      • getCredentialsNeverExpire

        @Nonnull
        public static Date getCredentialsNeverExpire()
        Returns a defensive copy of the sentinel value indicating credentials never expire. This method should be used instead of the deprecated CREDENTIALS_NEVER_EXPIRE constant to maintain immutability.
        Returns:
        A new Date instance representing credentials that never expire
      • getAccessKey

        @Nonnull
        public String getAccessKey()
        Returns:
        AWS Access Key ID, non-empty
      • getSecretKey

        @Nonnull
        public String getSecretKey()
        Returns:
        AWS Secret Key, non-empty
      • getSessionToken

        @Nullable
        public String getSessionToken()
        Returns:
        AWS Session Token. If the credentials are non-temporary, this will be null. Otherwise, non-empty.
      • isTemporary

        public boolean isTemporary()
        Checks if the credentials are temporary or not.
        Returns:
        true if the credentials are temporary (have an expiration).