Package org.italiangrid.voms.asn1
Class VOMSACUtils
java.lang.Object
org.italiangrid.voms.asn1.VOMSACUtils
- All Implemented Interfaces:
VOMSConstants
A set of VOMS AC handling utilities.
-
Field Summary
FieldsFields inherited from interface org.italiangrid.voms.asn1.VOMSConstants
VOMS_CERTS_OID, VOMS_EXTENSION_OID, VOMS_FQANS_OID, VOMS_GENERIC_ATTRS_OID, VOMS_HANDLED_EXTENSIONS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static X509Certificate[]
deserializeACCerts
(org.bouncycastle.cert.X509AttributeCertificateHolder ac) Deserializes the VOMS ACCerts extensiondeserializeACTargets
(org.bouncycastle.cert.X509AttributeCertificateHolder ac) deserializeFQANs
(org.bouncycastle.asn1.x509.IetfAttrSyntax attr) Deserializes the FQANs contained in aIetfAttrSyntax
objectprivate static List
<VOMSGenericAttribute> deserializeGAs
(org.bouncycastle.cert.X509AttributeCertificateHolder ac) Deserializes the VOMS generic attributesstatic List
<VOMSAttribute> deserializeVOMSAttributes
(List<org.bouncycastle.asn1.x509.AttributeCertificate> acs) Deserializes the information in a list of VOMS attribute certificates.static VOMSAttribute
deserializeVOMSAttributes
(org.bouncycastle.asn1.x509.AttributeCertificate ac) Deserializes the information in a VOMS attribute certificate.static List
<org.bouncycastle.asn1.x509.AttributeCertificate> Deserializes the VOMS Attribute certificates, if present, in a given certificate passed as argumentstatic List
<org.bouncycastle.asn1.x509.AttributeCertificate> getACsFromVOMSExtension
(byte[] vomsExtension) Deserializes the VOMS Attribute certificates in a given certificate extensionstatic byte[]
Returns the VOMS extension, if present, in a given certificateprivate static String
policyAuthoritySanityChecks
(org.bouncycastle.asn1.x509.IetfAttrSyntax attr) Peforms some sanity checks on the format of the policy authority field found in a VOMS extension.private static void
raiseACNonConformantError
(String errorString)
-
Field Details
-
POLICY_AUTHORITY_SEP
- See Also:
-
-
Constructor Details
-
VOMSACUtils
private VOMSACUtils()
-
-
Method Details
-
getVOMSExtensionFromCertificate
Returns the VOMS extension, if present, in a given certificate- Parameters:
cert
- theX509Certificate
where the extension will be searched- Returns:
- the DER-encoded octet string of the extension value or null if it is not present.
-
getACsFromVOMSExtension
public static List<org.bouncycastle.asn1.x509.AttributeCertificate> getACsFromVOMSExtension(byte[] vomsExtension) throws IOException Deserializes the VOMS Attribute certificates in a given certificate extension- Parameters:
vomsExtension
- the VOMS extension- Returns:
- the possibly empty
List
ofAttributeCertificate
extracted from a given extension - Throws:
IOException
- in case of deserialization errors
-
getACsFromCertificate
public static List<org.bouncycastle.asn1.x509.AttributeCertificate> getACsFromCertificate(X509Certificate cert) throws IOException Deserializes the VOMS Attribute certificates, if present, in a given certificate passed as argument- Parameters:
cert
- theX509Certificate
where the ACs will be searched- Returns:
- the possibly empty
List
ofAttributeCertificate
objects extracted from the VOMS extension - Throws:
IOException
- in case of deserialization errors
-
deserializeFQANs
Deserializes the FQANs contained in aIetfAttrSyntax
object- Parameters:
attr
- theIetfAttrSyntax
attribute syntax object containing the VOMS extension- Returns:
- a
List
of FQANs
-
deserializeACTargets
-
raiseACNonConformantError
-
policyAuthoritySanityChecks
Peforms some sanity checks on the format of the policy authority field found in a VOMS extension. The enforced format is: vo://host:port- Parameters:
attr
- theIetfAttrSyntax
attribute syntax object containing the VOMS extension- Returns:
- the validated policy authority as a
String
-
deserializeVOMSAttributes
public static List<VOMSAttribute> deserializeVOMSAttributes(List<org.bouncycastle.asn1.x509.AttributeCertificate> acs) Deserializes the information in a list of VOMS attribute certificates.- Parameters:
acs
- aList
of VOMS acs- Returns:
- a possibly empty list of
VOMSAttribute
-
deserializeVOMSAttributes
public static VOMSAttribute deserializeVOMSAttributes(org.bouncycastle.asn1.x509.AttributeCertificate ac) Deserializes the information in a VOMS attribute certificate.- Parameters:
ac
- a VOMSAttributeCertificate
- Returns:
- a
VOMSAttribute
object which provides more convenient access to the VOMS authorization information
-
deserializeGAs
private static List<VOMSGenericAttribute> deserializeGAs(org.bouncycastle.cert.X509AttributeCertificateHolder ac) Deserializes the VOMS generic attributes- Parameters:
ac
- the VOMSX509AttributeCertificateHolder
- Returns:
- the
List
ofVOMSGenericAttribute
contained in the ac
-
deserializeACCerts
private static X509Certificate[] deserializeACCerts(org.bouncycastle.cert.X509AttributeCertificateHolder ac) Deserializes the VOMS ACCerts extension- Parameters:
ac
- the VOMSX509AttributeCertificateHolder
- Returns:
- the parsed array of
X509Certificate
-