Top Description Fields Constructors Methods
org.osgi.service.condpermadmin

public Class BundleSignerCondition

extends Object
Class Inheritance
Imports
java.security.cert.X509Certificate, java.util.ArrayList, .List, .Map, org.osgi.framework.Bundle, .FrameworkUtil

Condition to test if the signer of a bundle matches or does not match a pattern. Since the bundle's signer can only change when the bundle is updated, this condition is immutable.

The condition expressed using a single String that specifies a Distinguished Name (DN) chain to match bundle signers against. DN's are encoded using IETF RFC 2253. Usually signers use certificates that are issued by certificate authorities, which also have a corresponding DN and certificate. The certificate authorities can form a chain of trust where the last DN and certificate is known by the framework. The signer of a bundle is expressed as signers DN followed by the DN of its issuer followed by the DN of the next issuer until the DN of the root certificate authority. Each DN is separated by a semicolon.

A bundle can satisfy this condition if one of its signers has a DN chain that matches the DN chain used to construct this condition. Wildcards (`*') can be used to allow greater flexibility in specifying the DN chains. Wildcards can be used in place of DNs, RDNs, or the value in an RDN. If a wildcard is used for a value of an RDN, the value must be exactly "*" and will match any value for the corresponding type in that RDN. If a wildcard is used for a RDN, it must be the first RDN and will match any number of RDNs (including zero RDNs).

Author
$Id: 9bb17ecb4b23c66940ab8d9f3b97b0a1040db929 $

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Condition

Returns:

A Condition which checks the signers of the specified bundle.
getCondition
(final Bundle
The Bundle being evaluated.
bundle
,
final ConditionInfo
The ConditionInfo from which to construct the condition. The ConditionInfo must specify one or two arguments. The first argument of the ConditionInfo specifies the chain of distinguished names pattern to match against the signer of the bundle. The Condition is satisfied if the signer of the bundle matches the pattern. The second argument of the ConditionInfo is optional. If a second argument is present and equal to "!", then the satisfaction of the Condition is negated. That is, the Condition is satisfied if the signer of the bundle does NOT match the pattern. If the second argument is present but does not equal "!", then the second argument is ignored.
info
)

Constructs a Condition that tries to match the passed Bundle's location to the location pattern.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CONDITION_TYPEback to summary
private static final String CONDITION_TYPE

Constructor Detail

BundleSignerConditionback to summary
private BundleSignerCondition()

Method Detail

getConditionback to summary
public static Condition getCondition(final Bundle bundle, final ConditionInfo info)

Constructs a Condition that tries to match the passed Bundle's location to the location pattern.

Parameters
bundle:Bundle

The Bundle being evaluated.

info:ConditionInfo

The ConditionInfo from which to construct the condition. The ConditionInfo must specify one or two arguments. The first argument of the ConditionInfo specifies the chain of distinguished names pattern to match against the signer of the bundle. The Condition is satisfied if the signer of the bundle matches the pattern. The second argument of the ConditionInfo is optional. If a second argument is present and equal to "!", then the satisfaction of the Condition is negated. That is, the Condition is satisfied if the signer of the bundle does NOT match the pattern. If the second argument is present but does not equal "!", then the second argument is ignored.

Returns:Condition

A Condition which checks the signers of the specified bundle.