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

org.spongycastle.util.encoders.UrlBase64Encoder Maven / Gradle / Ivy

Go to download

Spongy Castle is a package-rename (org.bouncycastle.* to org.spongycastle.*) of Bouncy Castle intended for Android. Android ships with a stripped-down version of Bouncy Castle - this causes classloader collisions if you try to add an alternative (updated/complete) Bouncy Castle jar. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5.

There is a newer version: 1.46.99.3-UNOFFICIAL-ROBERTO-RELEASE
Show newest version
package org.spongycastle.util.encoders;

/**
 * Convert binary data to and from UrlBase64 encoding.  This is identical to
 * Base64 encoding, except that the padding character is "." and the other 
 * non-alphanumeric characters are "-" and "_" instead of "+" and "/".
 * 

* The purpose of UrlBase64 encoding is to provide a compact encoding of binary * data that is safe for use as an URL parameter. Base64 encoding does not * produce encoded values that are safe for use in URLs, since "/" can be * interpreted as a path delimiter; "+" is the encoded form of a space; and * "=" is used to separate a name from the corresponding value in an URL * parameter. */ public class UrlBase64Encoder extends Base64Encoder { public UrlBase64Encoder() { encodingTable[encodingTable.length - 2] = (byte) '-'; encodingTable[encodingTable.length - 1] = (byte) '_'; padding = (byte) '.'; // we must re-create the decoding table with the new encoded values. initialiseDecodingTable(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy