Codota Logo
ServiceAccountJwtAccessCredentials.getPrivateKeyId
Code IndexAdd Codota to your IDE (free)

How to use
getPrivateKeyId
method
in
com.google.auth.oauth2.ServiceAccountJwtAccessCredentials

Best Java code snippets using com.google.auth.oauth2.ServiceAccountJwtAccessCredentials.getPrivateKeyId (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: googleapis/gax-java

@Test
public void serviceAccountReplacedWithJwtTokens() throws Exception {
 ServiceAccountCredentials serviceAccountCredentials =
   ServiceAccountCredentials.newBuilder()
     .setClientId("fake-client-id")
     .setClientEmail("fake@example.com")
     .setPrivateKeyId("fake-private-key")
     .setPrivateKey(Mockito.mock(PrivateKey.class))
     .build();
 PowerMockito.mockStatic(GoogleCredentials.class);
 Mockito.when(GoogleCredentials.getApplicationDefault()).thenReturn(serviceAccountCredentials);
 GoogleCredentialsProvider provider =
   GoogleCredentialsProvider.newBuilder()
     .setScopesToApply(ImmutableList.of("scope1", "scope2"))
     .setJwtEnabledScopes(ImmutableList.of("scope1"))
     .build();
 Credentials credentials = provider.getCredentials();
 assertThat(credentials).isInstanceOf(ServiceAccountJwtAccessCredentials.class);
 ServiceAccountJwtAccessCredentials jwtCreds = (ServiceAccountJwtAccessCredentials) credentials;
 assertThat(jwtCreds.getClientId()).isEqualTo(serviceAccountCredentials.getClientId());
 assertThat(jwtCreds.getClientEmail()).isEqualTo(serviceAccountCredentials.getClientEmail());
 assertThat(jwtCreds.getPrivateKeyId()).isEqualTo(serviceAccountCredentials.getPrivateKeyId());
 assertThat(jwtCreds.getPrivateKey()).isEqualTo(serviceAccountCredentials.getPrivateKey());
}
origin: googleapis/google-auth-library-java

@Test 
public void constructor_allParameters_constructs() throws IOException {
 PrivateKey privateKey = ServiceAccountCredentials.privateKeyFromPkcs8(SA_PRIVATE_KEY_PKCS8);
 ServiceAccountJwtAccessCredentials credentials = ServiceAccountJwtAccessCredentials.newBuilder()
   .setClientId(SA_CLIENT_ID)
   .setClientEmail(SA_CLIENT_EMAIL)
   .setPrivateKey(privateKey)
   .setPrivateKeyId(SA_PRIVATE_KEY_ID)
   .build();
 
 assertEquals(SA_CLIENT_ID, credentials.getClientId());
 assertEquals(SA_CLIENT_EMAIL, credentials.getClientEmail());
 assertEquals(privateKey, credentials.getPrivateKey());
 assertEquals(SA_PRIVATE_KEY_ID, credentials.getPrivateKeyId());
}
com.google.auth.oauth2ServiceAccountJwtAccessCredentialsgetPrivateKeyId

Popular methods of ServiceAccountJwtAccessCredentials

  • newBuilder
  • getClientEmail
  • getPrivateKey
  • fromPkcs8
    Factory using PKCS#8 for the private key.
  • fromStream
    Returns credentials defined by a Service Account key file in JSON format from the Google Developers
  • getClientId
  • <init>
    Constructor with full information.
  • blockingGetToCallback
  • createCache
  • equals
  • fromJson
    Returns service account credentials defined by JSON using the format supported by the Google Develop
  • getAccount
  • fromJson,
  • getAccount,
  • getJwtAccess,
  • getRequestMetadata,
  • hashCode,
  • sign,
  • toString

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Notification (javax.management)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now