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

com.microsoft.azure.management.graphrbac.CertificateCredential Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure Graph RBAC Management SDK. This package has been deprecated. A replacement package com.azure.resourcemanager:azure-resourcemanager-authorization is available as of 31-March-2022. We strongly encourage you to upgrade to continue receiving updates. See Migration Guide https://aka.ms/java-track2-migration-guide for guidance on upgrading. Refer to our deprecation policy https://azure.github.io/azure-sdk/policies_support.html for more details.

There is a newer version: 1.41.4
Show newest version
/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 */

package com.microsoft.azure.management.graphrbac;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.graphrbac.implementation.KeyCredentialInner;
import com.microsoft.azure.management.resources.fluentcore.model.Attachable;
import com.microsoft.azure.management.resources.fluentcore.model.HasInner;
import org.joda.time.DateTime;
import org.joda.time.Duration;

import java.io.OutputStream;

/**
 * An immutable client-side representation of an Azure AD credential.
 */
@Fluent(ContainerName = "/Microsoft.Azure.Management.Graph.RBAC.Fluent")
public interface CertificateCredential extends
        Credential,
        HasInner {

    /**************************************************************
     * Fluent interfaces to attach a credential
     **************************************************************/

    /**
     * The entirety of a credential definition.
     * @param  the return type of the final {@link Attachable#attach()}
     */
    interface Definition extends
            DefinitionStages.Blank,
            DefinitionStages.WithCertificateType,
            DefinitionStages.WithPublicKey,
            DefinitionStages.WithSymmetricKey,
            DefinitionStages.WithAttach,
            DefinitionStages.WithAuthFileCertificate,
            DefinitionStages.WithAuthFileCertificatePassword {
    }

    /**
     * Grouping of credential definition stages applicable as part of a application or service principal creation.
     */
    interface DefinitionStages {
        /**
         * The first stage of a credential definition.
         *
         * @param  the stage of the parent definition to return to after attaching this definition
         */
        interface Blank extends WithCertificateType {
        }

        /**
         * The credential definition stage allowing the certificate type to be set.
         * @param  the stage of the parent definition to return to after attaching this definition
         */
        interface WithCertificateType {
            /**
             * Specifies the type of the certificate to be Asymmetric X509.
             * @return the next stage in credential definition
             */
            WithPublicKey withAsymmetricX509Certificate();

            /**
             * Specifies the type of the certificate to be symmetric.
             * @return the next stage in credential definition
             */
            WithSymmetricKey withSymmetricEncryption();
        }

        /**
         * The credential definition stage allowing the public key to be set.
         * @param  the stage of the parent definition to return to after attaching this definition
         */
        interface WithPublicKey {
            /**
             * Specifies the public key for an asymmetric X509 certificate.
             * @param certificate the certificate content
             * @return the next stage in credential definition
             */
            WithAttach withPublicKey(byte[] certificate);
        }

        /**
         * The credential definition stage allowing the secret key to be set.
         * @param  the stage of the parent definition to return to after attaching this definition
         */
        interface WithSymmetricKey {
            /**
             * Specifies the secret key for a symmetric encryption.
             * @param secret the secret key content
             * @return the next stage in credential definition
             */
            WithAttach withSecretKey(byte[] secret);
        }

        /**
         * The credential definition stage allowing start date to be set.
         * @param  the stage of the parent definition to return to after attaching this definition
         */
        interface WithStartDate {
            /**
             * Specifies the start date after which password or key would be valid. Default value is current time.
             * @param startDate the start date for validity
             * @return the next stage in credential definition
             */
            WithAttach withStartDate(DateTime startDate);
        }

        /**
         * The credential definition stage allowing the duration of key validity to be set.
         * @param  the stage of the parent definition to return to after attaching this definition
         */
        interface WithDuration {
            /**
             * Specifies the duration for which password or key would be valid. Default value is 1 year.
             * @param duration the duration of validity
             * @return the next stage in credential definition
             */
            WithAttach withDuration(Duration duration);
        }

        /**
         * A credential definition stage allowing exporting the auth file for the service principal.
         */
        interface WithAuthFile {
            /**
             * Export the information of this service principal into an auth file.
             * @param outputStream the output stream to export the file
             * @return the next stage in credential definition
             */
            WithAuthFileCertificate withAuthFileToExport(OutputStream outputStream);
        }

        /**
         * A credential definition stage allowing specifying the private key for exporting an auth file.
         */
        interface WithAuthFileCertificate {
            /**
             * Export the information of this service principal into an auth file.
             * @param privateKeyPath the path to the private key file
             * @return the next stage in credential definition
             */
            WithAuthFileCertificatePassword withPrivateKeyFile(String privateKeyPath);
        }

        /**
         * A credential definition stage allowing specifying the password for the private key for exporting an auth file.
         */
        interface WithAuthFileCertificatePassword {
            /**
             * Export the information of this service principal into an auth file.
             * @param privateKeyPassword the password for the private key
             * @return the next stage in credential definition
             */
            WithAttach withPrivateKeyPassword(String privateKeyPassword);
        }

        /** The final stage of the credential definition.
         * 

* At this stage, more settings can be specified, or the credential definition can be * attached to the parent application / service principal definition * using {@link WithAttach#attach()}. * @param the return type of {@link WithAttach#attach()} */ interface WithAttach extends Attachable.InDefinition, WithStartDate, WithDuration, WithAuthFile { } } /** * The entirety of a credential definition as part of a application or service principal update. * @param the return type of the final {@link UpdateDefinitionStages.WithAttach#attach()} */ interface UpdateDefinition extends UpdateDefinitionStages.Blank, UpdateDefinitionStages.WithCertificateType, UpdateDefinitionStages.WithPublicKey, UpdateDefinitionStages.WithSymmetricKey, UpdateDefinitionStages.WithAttach, UpdateDefinitionStages.WithAuthFileCertificate, UpdateDefinitionStages.WithAuthFileCertificatePassword { } /** * Grouping of credential definition stages applicable as part of a application or service principal update. */ interface UpdateDefinitionStages { /** * The first stage of a credential definition. * * @param the stage of the parent definition to return to after attaching this definition */ interface Blank extends WithCertificateType { } /** * The credential definition stage allowing the certificate type to be set. * @param the stage of the parent definition to return to after attaching this definition */ interface WithCertificateType { /** * Specifies the type of the certificate to be asymmetric X509. * @return the next stage in credential definition */ WithPublicKey withAsymmetricX509Certificate(); /** * Specifies the type of the certificate to be symmetric. * @return the next stage in credential definition */ WithSymmetricKey withSymmetricEncryption(); } /** * The credential definition stage allowing the public key to be set. * @param the stage of the parent definition to return to after attaching this definition */ interface WithPublicKey { /** * Specifies the public key for an asymmetric X509 certificate. * @param certificate the certificate content * @return the next stage in credential definition */ WithAttach withPublicKey(byte[] certificate); } /** * The credential definition stage allowing the secret key to be set. * @param the stage of the parent definition to return to after attaching this definition */ interface WithSymmetricKey { /** * Specifies the secret key for a symmetric encryption. * @param secret the secret key content * @return the next stage in credential definition */ WithAttach withSecretKey(byte[] secret); } /** * The credential definition stage allowing start date to be set. * @param the stage of the parent definition to return to after attaching this definition */ interface WithStartDate { /** * Specifies the start date after which password or key would be valid. Default value is current time. * @param startDate the start date for validity * @return the next stage in credential definition */ WithAttach withStartDate(DateTime startDate); } /** * The credential definition stage allowing the duration of key validity to be set. * @param the stage of the parent definition to return to after attaching this definition */ interface WithDuration { /** * Specifies the duration for which password or key would be valid. Default value is 1 year. * @param duration the duration of validity * @return the next stage in credential definition */ WithAttach withDuration(Duration duration); } /** * A credential definition stage allowing exporting the auth file for the service principal. */ interface WithAuthFile { /** * Export the information of this service principal into an auth file. * @param outputStream the output stream to export the file * @return the next stage in credential definition */ WithAuthFileCertificate withAuthFileToExport(OutputStream outputStream); } /** * A credential definition stage allowing specifying the private key for exporting an auth file. */ interface WithAuthFileCertificate { /** * Export the information of this service principal into an auth file. * @param privateKeyPath the path to the private key file * @return the next stage in credential definition */ WithAuthFileCertificatePassword withPrivateKeyFile(String privateKeyPath); } /** * A credential definition stage allowing specifying the password for the private key for exporting an auth file. */ interface WithAuthFileCertificatePassword { /** * Export the information of this service principal into an auth file. * @param privateKeyPassword the password for the private key * @return the next stage in credential definition */ WithAttach withPrivateKeyPassword(String privateKeyPassword); } /** The final stage of the credential definition. *

* At this stage, more settings can be specified, or the credential definition can be * attached to the parent application / service principal definition * using {@link WithAttach#attach()}. * @param the return type of {@link WithAttach#attach()} */ interface WithAttach extends Attachable.InUpdate, WithStartDate, WithDuration, WithAuthFile { } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy