本文整理匯總了Java中org.whispersystems.textsecure.internal.util.Base64.encodeBytes方法的典型用法代碼示例。如果您正苦於以下問題:Java Base64.encodeBytes方法的具體用法?Java Base64.encodeBytes怎麽用?Java Base64.encodeBytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.whispersystems.textsecure.internal.util.Base64
的用法示例。
在下文中一共展示了Base64.encodeBytes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: encrypt
import org.whispersystems.textsecure.internal.util.Base64; //導入方法依賴的package包/類
public OutgoingPushMessage encrypt(AxolotlAddress destination, byte[] unpaddedMessage) {
SessionCipher sessionCipher = new SessionCipher(this.axolotlStore, destination);
PushTransportDetails transportDetails = new PushTransportDetails(sessionCipher.getSessionVersion());
CiphertextMessage message = sessionCipher.encrypt(transportDetails.getPaddedMessageBody(unpaddedMessage));
int remoteRegistrationId = sessionCipher.getRemoteRegistrationId();
String body = Base64.encodeBytes(message.serialize());
byte type;
switch(message.getType()) {
case 2:
type = 1;
break;
case 3:
type = 3;
break;
default:
throw new AssertionError("Bad type: " + message.getType());
}
return new OutgoingPushMessage(type, destination.getDeviceId(), remoteRegistrationId, body);
}
示例2: getAuthorizationHeader
import org.whispersystems.textsecure.internal.util.Base64; //導入方法依賴的package包/類
private String getAuthorizationHeader() {
try {
return "Basic " + Base64.encodeBytes((localNumber + ":" + password).getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
}
示例3: getAuthorizationHeader
import org.whispersystems.textsecure.internal.util.Base64; //導入方法依賴的package包/類
private String getAuthorizationHeader() {
try {
return "Basic " + Base64.encodeBytes((localNumber + ":" + password).getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
}
示例4: OutgoingPushMessage
import org.whispersystems.textsecure.internal.util.Base64; //導入方法依賴的package包/類
public OutgoingPushMessage(PushAddress address, PushBody body) {
this.type = body.getType();
this.destinationDeviceId = address.getDeviceId();
this.destinationRegistrationId = body.getRemoteRegistrationId();
this.body = Base64.encodeBytes(body.getBody());
}