Class DigitalID
- java.lang.Object
-
- es.gob.afirma.tsl.parsing.impl.common.DigitalID
-
- All Implemented Interfaces:
java.io.Serializable
public class DigitalID extends java.lang.Object implements java.io.SerializableClass that defines a Digital Identity with all its information not dependent of the specification or TSL version.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.1, 15/06/2021.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intTYPE_KEYVALUEConstant attribute that represents a digital identity type: Key Value.static intTYPE_OTHERConstant attribute that represents a digital identity type: Other.static intTYPE_X509CERTIFICATEConstant attribute that represents a digital identity type: X509 Certificate.static intTYPE_X509SKIConstant attribute that represents a digital identity type: X509 SKI.static intTYPE_X509SUBJECTNAMEConstant attribute that represents a digital identity type: X509 Subject Name.
-
Constructor Summary
Constructors Constructor Description DigitalID(int digitalIdentityType)Constructor method for the class DigitalID.java.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.w3.x2000.x09.xmldsig.KeyValueTypegetKeyValue()Gets the value of the attributekeyValue.java.lang.StringgetOther()Gets the value of the attributeother.org.bouncycastle.asn1.x509.SubjectKeyIdentifiergetSki()Gets the value of the attributeski.intgetType()Gets the value of the attributetype.java.security.cert.X509CertificategetX509cert()Gets the value of the attributex509cert.java.lang.StringgetX509SubjectName()Gets the value of the attributex509SubjectName.voidsetKeyValue(org.w3.x2000.x09.xmldsig.KeyValueType keyValueDI)Sets the value of the attributekeyValue.voidsetOther(java.lang.String otherDI)Sets the value of the attributeother.voidsetSki(byte[] skiByteDI)Sets the value of the attributeski.voidsetSki(org.bouncycastle.asn1.x509.SubjectKeyIdentifier skiDI)Sets the value of the attributeski.voidsetX509cert(byte[] x509certBytesDI)Sets the value of the attributex509cert.voidsetX509cert(java.security.cert.X509Certificate x509certDI)Sets the value of the attributex509cert.voidsetX509SubjectName(java.lang.String x509SubjectNameDI)Sets the value of the attributex509SubjectName.
-
-
-
Field Detail
-
TYPE_X509CERTIFICATE
public static final int TYPE_X509CERTIFICATE
Constant attribute that represents a digital identity type: X509 Certificate.- See Also:
- Constant Field Values
-
TYPE_X509SUBJECTNAME
public static final int TYPE_X509SUBJECTNAME
Constant attribute that represents a digital identity type: X509 Subject Name.- See Also:
- Constant Field Values
-
TYPE_KEYVALUE
public static final int TYPE_KEYVALUE
Constant attribute that represents a digital identity type: Key Value.- See Also:
- Constant Field Values
-
TYPE_X509SKI
public static final int TYPE_X509SKI
Constant attribute that represents a digital identity type: X509 SKI.- See Also:
- Constant Field Values
-
TYPE_OTHER
public static final int TYPE_OTHER
Constant attribute that represents a digital identity type: Other.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DigitalID
public DigitalID(int digitalIdentityType)
Constructor method for the class DigitalID.java.- Parameters:
digitalIdentityType- Digital identity type. It must be one of the following: -TYPE_X509CERTIFICATE. -TYPE_X509SUBJECTNAME. -TYPE_KEYVALUE. -TYPE_X509SKI. -TYPE_OTHER.
-
-
Method Detail
-
getType
public final int getType()
Gets the value of the attributetype.- Returns:
- the value of the attribute
type.
-
getX509cert
public final java.security.cert.X509Certificate getX509cert()
Gets the value of the attributex509cert.- Returns:
- the value of the attribute
x509cert.
-
setX509cert
public final void setX509cert(java.security.cert.X509Certificate x509certDI)
Sets the value of the attributex509cert.- Parameters:
x509certDI- The value for the attributex509cert.
-
setX509cert
public final void setX509cert(byte[] x509certBytesDI) throws TSLParsingExceptionSets the value of the attributex509cert.- Parameters:
x509certBytesDI- The value (in bytes) for the attributex509cert.- Throws:
TSLParsingException- In case of some error parsing the X509 certificate.
-
getX509SubjectName
public final java.lang.String getX509SubjectName()
Gets the value of the attributex509SubjectName.- Returns:
- the value of the attribute
x509SubjectName.
-
setX509SubjectName
public final void setX509SubjectName(java.lang.String x509SubjectNameDI) throws TSLParsingExceptionSets the value of the attributex509SubjectName.- Parameters:
x509SubjectNameDI- The value for the attributex509SubjectName.- Throws:
TSLParsingException- In case of the input string wasnullor empty.
-
getKeyValue
public final org.w3.x2000.x09.xmldsig.KeyValueType getKeyValue()
Gets the value of the attributekeyValue.- Returns:
- the value of the attribute
keyValue.
-
setKeyValue
public final void setKeyValue(org.w3.x2000.x09.xmldsig.KeyValueType keyValueDI) throws TSLParsingExceptionSets the value of the attributekeyValue.- Parameters:
keyValueDI- The value for the attributekeyValue.- Throws:
TSLParsingException- In case of the input parameter wasnull, or not is defined RSA or DSA values.
-
getSki
public final org.bouncycastle.asn1.x509.SubjectKeyIdentifier getSki()
Gets the value of the attributeski.- Returns:
- the value of the attribute
ski.
-
setSki
public final void setSki(org.bouncycastle.asn1.x509.SubjectKeyIdentifier skiDI)
Sets the value of the attributeski.- Parameters:
skiDI- The value for the attributeski.
-
setSki
public final void setSki(byte[] skiByteDI)
Sets the value of the attributeski.- Parameters:
skiByteDI- The value (in bytes) for the attributeski.
-
getOther
public final java.lang.String getOther()
Gets the value of the attributeother.- Returns:
- the value of the attribute
other.
-
-