Top Description Fields Constructors Methods
org.bouncycastle.crypto.util

public Class BasicAlphabetMapper

extends Object
implements AlphabetMapper
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.AlphabetMapper
Imports
java.util.HashMap, .Map, org.bouncycastle.crypto.AlphabetMapper

A basic alphabet mapper that just creates a mapper based on the passed in array of characters.

Field Summary

Modifier and TypeField and Description
private Map<Integer, Character>
private Map<Character, Integer>

Constructor Summary

AccessConstructor and Description
public
BasicAlphabetMapper(String
a String of characters making up the alphabet.
alphabet
)

Base constructor.

public
BasicAlphabetMapper(char[]
an array of characters making up the alphabet.
alphabet
)

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public char[]
convertToChars(byte[]
input array of indexes.
input
)

Implements org.bouncycastle.crypto.AlphabetMapper.convertToChars.

Return a char[] for this alphabet based on the indexes passed.

public byte[]
convertToIndexes(char[]
characters to be mapped.
input
)

Implements org.bouncycastle.crypto.AlphabetMapper.convertToIndexes.

Return the passed in char[] as a byte array of indexes (indexes can be more than 1 byte)

public int
getRadix()

Implements org.bouncycastle.crypto.AlphabetMapper.getRadix.

Return the number of characters in the alphabet.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charMapback to summary
private Map<Integer, Character> charMap
indexMapback to summary
private Map<Character, Integer> indexMap

Constructor Detail

BasicAlphabetMapperback to summary
public BasicAlphabetMapper(String alphabet)

Base constructor.

Parameters
alphabet:String

a String of characters making up the alphabet.

BasicAlphabetMapperback to summary
public BasicAlphabetMapper(char[] alphabet)

Base constructor.

Parameters
alphabet:char[]

an array of characters making up the alphabet.

Method Detail

convertToCharsback to summary
public char[] convertToChars(byte[] input)

Implements org.bouncycastle.crypto.AlphabetMapper.convertToChars.

Doc from org.bouncycastle.crypto.AlphabetMapper.convertToChars.

Return a char[] for this alphabet based on the indexes passed.

Parameters
input:byte[]

input array of indexes.

Returns:char[]

an array of char corresponding to the index values.

convertToIndexesback to summary
public byte[] convertToIndexes(char[] input)

Implements org.bouncycastle.crypto.AlphabetMapper.convertToIndexes.

Doc from org.bouncycastle.crypto.AlphabetMapper.convertToIndexes.

Return the passed in char[] as a byte array of indexes (indexes can be more than 1 byte)

Parameters
input:char[]

characters to be mapped.

Returns:byte[]

an index array.

getRadixback to summary
public int getRadix()

Implements org.bouncycastle.crypto.AlphabetMapper.getRadix.

Doc from org.bouncycastle.crypto.AlphabetMapper.getRadix.

Return the number of characters in the alphabet.

Returns:int

the radix for the alphabet.