FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Also accept InputStream at setServiceAccountPrivateKeyFromP12File by kliakos · Pull Request #1011 · googleapis/google-api-java-client · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -662,17 +662,33 @@ public Builder setServiceAccountPrivateKeyId(String serviceAccountPrivateKeyId)
* the return type, but nothing else.
* </p>
*
* @param p12File input stream to the p12 file (closed at the end of this method in a finally
* block)
* @param p12File p12 file object
*/
public Builder setServiceAccountPrivateKeyFromP12File(File p12File)
throws GeneralSecurityException, IOException {
serviceAccountPrivateKey = SecurityUtils.loadPrivateKeyFromKeyStore(
SecurityUtils.getPkcs12KeyStore(), new FileInputStream(p12File), "notasecret",
"privatekey", "notasecret");
setServiceAccountPrivateKeyFromP12File(new FileInputStream(p12File));
return this;
}

/**
* Sets the private key to use with the service account flow or {@code null} for none.
*
* <p>
* Overriding is only supported for the purpose of calling the super implementation and changing
* the return type, but nothing else.
* </p>
*
* @param p12FileInputStream input stream to the p12 file (closed at the end of this method in a finally
* block)
*/
public Builder setServiceAccountPrivateKeyFromP12File(InputStream p12FileInputStream)
throws GeneralSecurityException, IOException {
serviceAccountPrivateKey = SecurityUtils.loadPrivateKeyFromKeyStore(
SecurityUtils.getPkcs12KeyStore(), p12FileInputStream, "notasecret",
"privatekey", "notasecret");
return this;
}

/**
* {@link Beta} <br/>
* Sets the private key to use with the service account flow or {@code null} for none.
Expand Down

Back | FazBrowse Home | New Git URL