Search in sources :

Example 1 with SignBlobRequest

use of com.google.cloud.iam.credentials.v1.SignBlobRequest in project gapic-generator-java by googleapis.

the class AsyncSignBlob method asyncSignBlob.

public static void asyncSignBlob() throws Exception {
    // It may require modifications to work in your environment.
    try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
        SignBlobRequest request = SignBlobRequest.newBuilder().setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()).addAllDelegates(new ArrayList<String>()).setPayload(ByteString.EMPTY).build();
        ApiFuture<SignBlobResponse> future = iamCredentialsClient.signBlobCallable().futureCall(request);
        // Do something.
        SignBlobResponse response = future.get();
    }
}
Also used : SignBlobRequest(com.google.cloud.iam.credentials.v1.SignBlobRequest) IamCredentialsClient(com.google.cloud.iam.credentials.v1.IamCredentialsClient) ByteString(com.google.protobuf.ByteString) SignBlobResponse(com.google.cloud.iam.credentials.v1.SignBlobResponse)

Example 2 with SignBlobRequest

use of com.google.cloud.iam.credentials.v1.SignBlobRequest in project gapic-generator-java by googleapis.

the class SyncSignBlob method syncSignBlob.

public static void syncSignBlob() throws Exception {
    // It may require modifications to work in your environment.
    try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) {
        SignBlobRequest request = SignBlobRequest.newBuilder().setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()).addAllDelegates(new ArrayList<String>()).setPayload(ByteString.EMPTY).build();
        SignBlobResponse response = iamCredentialsClient.signBlob(request);
    }
}
Also used : SignBlobRequest(com.google.cloud.iam.credentials.v1.SignBlobRequest) IamCredentialsClient(com.google.cloud.iam.credentials.v1.IamCredentialsClient) ByteString(com.google.protobuf.ByteString) SignBlobResponse(com.google.cloud.iam.credentials.v1.SignBlobResponse)

Aggregations

IamCredentialsClient (com.google.cloud.iam.credentials.v1.IamCredentialsClient)2 SignBlobRequest (com.google.cloud.iam.credentials.v1.SignBlobRequest)2 SignBlobResponse (com.google.cloud.iam.credentials.v1.SignBlobResponse)2 ByteString (com.google.protobuf.ByteString)2