Top Description Inners Fields Constructors Methods
org.bouncycastle.pkix

public Class SubjectPublicKeyInfoChecker

extends Object
Class Inheritance
Imports
java.io.IOException, java.math.BigInteger, java.security.AccessControlException, .AccessController, .PrivilegedAction, .Security, java.util.HashMap, .Map, .WeakHashMap, org.bouncycastle.asn1.ASN1Integer, .ASN1ObjectIdentifier, .ASN1Sequence, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers, .RSAPublicKey, org.bouncycastle.asn1.x509.SubjectPublicKeyInfo, .X509ObjectIdentifiers, org.bouncycastle.asn1.x9.X962Parameters, .X9FieldID, .X9ObjectIdentifiers, org.bouncycastle.crypto.CryptoServicesRegistrar, org.bouncycastle.math.Primes, org.bouncycastle.util.BigIntegers, .Strings

A checker for vetting subject public keys based on the direct checking of the ASN.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final BigInteger
private static final SubjectPublicKeyInfoChecker.Cache
private static final SubjectPublicKeyInfoChecker.Cache

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
private static int
getNumberOfIterations(int bits, int certainty)

private static boolean
public static boolean

Returns:

true if the override was already set true in thread local, false otherwise.
removeThreadOverride
(String
the property name for the override.
propertyName
)

Remove any value for the specified override property for the current thread only.

public static boolean

Returns:

true if the override was already set true, false otherwise.
setThreadOverride
(String
the property name for the override.
propertyName
,
boolean
true if the override should be enabled, false if it should be disabled.
enable
)

Enable the specified override property for the current thread only.

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SMALL_PRIMES_PRODUCTback to summary
private static final BigInteger SMALL_PRIMES_PRODUCT
validatedModsback to summary
private static final SubjectPublicKeyInfoChecker.Cache validatedMods
validatedQsback to summary
private static final SubjectPublicKeyInfoChecker.Cache validatedQs

Constructor Detail

SubjectPublicKeyInfoCheckerback to summary
public SubjectPublicKeyInfoChecker()

Method Detail

checkInfoback to summary
public static void checkInfo(SubjectPublicKeyInfo pubInfo)
getNumberOfIterationsback to summary
private static int getNumberOfIterations(int bits, int certainty)
hasAnySmallFactorsback to summary
private static boolean hasAnySmallFactors(BigInteger modulus)
removeThreadOverrideback to summary
public static boolean removeThreadOverride(String propertyName)

Remove any value for the specified override property for the current thread only.

Parameters
propertyName:String

the property name for the override.

Returns:boolean

true if the override was already set true in thread local, false otherwise.

setThreadOverrideback to summary
public static boolean setThreadOverride(String propertyName, boolean enable)

Enable the specified override property for the current thread only.

Parameters
propertyName:String

the property name for the override.

enable:boolean

true if the override should be enabled, false if it should be disabled.

Returns:boolean

true if the override was already set true, false otherwise.

validateback to summary
private static void validate(BigInteger modulus)
org.bouncycastle.pkix back to summary

private Class SubjectPublicKeyInfoChecker.Cache

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final BigInteger[]
private int
private final Map<BigInteger, Boolean>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public synchronized void
add(BigInteger value)

public synchronized void
public synchronized boolean
public synchronized int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

preserveback to summary
private final BigInteger[] preserve
preserveCounterback to summary
private int preserveCounter
valuesback to summary
private final Map<BigInteger, Boolean> values

Constructor Detail

Cacheback to summary
private Cache()

Method Detail

addback to summary
public synchronized void add(BigInteger value)
clearback to summary
public synchronized void clear()
containsback to summary
public synchronized boolean contains(BigInteger value)
sizeback to summary
public synchronized int size()
org.bouncycastle.pkix back to summary

private Class SubjectPublicKeyInfoChecker.Properties

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final ThreadLocal<T>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static int

Returns:

value of property, or default if not found, as an int.
asInteger
(String
name of property.
propertyName
,
int
integer to return if property not defined.
defaultValue
)

Return propertyName as an integer, defaultValue used if not defined.

pack-priv static String

Returns:

value of property as a String, null if not defined.
getPropertyValue
(final String
name of property.
propertyName
)

Return the String value of the property propertyName.

pack-priv static boolean

Returns:

true if the property is set to "true", false otherwise.
isOverrideSet
(String
the property name for the override.
propertyName
)

Return whether a particular override has been set to true.

private static boolean
pack-priv static boolean
pack-priv static boolean
setThreadOverride(String propertyName, boolean enable)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

threadPropertiesback to summary
private static final ThreadLocal<T> threadProperties

Constructor Detail

Propertiesback to summary
private Properties()

Method Detail

asIntegerback to summary
pack-priv static int asInteger(String propertyName, int defaultValue)

Return propertyName as an integer, defaultValue used if not defined.

Parameters
propertyName:String

name of property.

defaultValue:int

integer to return if property not defined.

Returns:int

value of property, or default if not found, as an int.

getPropertyValueback to summary
pack-priv static String getPropertyValue(final String propertyName)

Return the String value of the property propertyName. Property valuation starts with java.security, then thread local, then system properties.

Parameters
propertyName:String

name of property.

Returns:String

value of property as a String, null if not defined.

isOverrideSetback to summary
pack-priv static boolean isOverrideSet(String propertyName)

Return whether a particular override has been set to true.

Parameters
propertyName:String

the property name for the override.

Returns:boolean

true if the property is set to "true", false otherwise.

isSetTrueback to summary
private static boolean isSetTrue(String p)
removeThreadOverrideback to summary
pack-priv static boolean removeThreadOverride(String propertyName)
setThreadOverrideback to summary
pack-priv static boolean setThreadOverride(String propertyName, boolean enable)