cl.sii.dte
Class Semilla

java.lang.Object
  |
  +--cl.sii.dte.Semilla

public class Semilla
extends Object

Esta clase representa el objeto Semilla que devuelve el SII al momento de autenticarse de forma automatica.

Version:
1.0
Author:
José Urzúa
Field Summary
private  String estado
           
private  org.jdom.Element firma
           
private  String semilla
           
 String signedSeed
           
 
Constructor Summary
Semilla()
          Constructor de Semilla
 
Method Summary
 org.jdom.Document genDocument(org.jdom.Namespace ns)
          Method getDocument.
 org.jdom.Element getDOMElement(String tagName, org.jdom.Namespace ns)
          Method getDOMElement.
 String getEstado()
          Method getEstado.
 org.jdom.Element getFirma()
          Method getFirma.
static void getNiceXML(org.jdom.Document doc, OutputStream out)
          Escribe el valor de la semilla en un OutputStream
 String getSemilla()
          Method getSemilla.
 String rescataToken(String data)
          Method rescataToken Descompone el string dado como parametro para sacar los valores del Token
 void setEstado(String estado)
          Method setEstado.
 void setFirma(org.jdom.Element firma)
          Method setFirma.
 void setSemilla(String semilla)
          Method setSemilla.
 void setValores(String data)
          Method setValores.
 void sign(PrivateKey pKey, X509Certificate cert, org.jdom.Namespace ns)
          Método encargado de firmar la semilla
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

estado

private String estado

semilla

private String semilla

signedSeed

public String signedSeed

firma

private org.jdom.Element firma
Constructor Detail

Semilla

public Semilla()
Constructor de Semilla

Method Detail

rescataToken

public String rescataToken(String data)
                    throws SemillaException
Method rescataToken Descompone el string dado como parametro para sacar los valores del Token

Parameters:
data -
SemillaException

setValores

public void setValores(String data)
                throws SemillaException
Method setValores. Descompone el string dado como parametro para sacar los valores de la semilla y del estado y asignarlos a las variables locales.

Parameters:
data -
SemillaException

getFirma

public org.jdom.Element getFirma()
Method getFirma.

Returns:
Element

setFirma

public void setFirma(org.jdom.Element firma)
Method setFirma.

Parameters:
firma -

getEstado

public String getEstado()
Method getEstado.

Returns:
String

setEstado

public void setEstado(String estado)
Method setEstado.

Parameters:
estado -

getSemilla

public String getSemilla()
Method getSemilla.

Returns:
semilla

setSemilla

public void setSemilla(String semilla)
Method setSemilla.

Parameters:
semilla -

getDOMElement

public org.jdom.Element getDOMElement(String tagName,
                                      org.jdom.Namespace ns)
Method getDOMElement.

Parameters:
tagName -
ns -
Returns:
Element

genDocument

public org.jdom.Document genDocument(org.jdom.Namespace ns)
                              throws InvalidKeyException,
                                     SignatureException,
                                     NoSuchAlgorithmException
Method getDocument.

Returns:
Document
Throws:
TimbreException
InvalidKeyException
SignatureException
NoSuchAlgorithmException
CodigoException

sign

public void sign(PrivateKey pKey,
                 X509Certificate cert,
                 org.jdom.Namespace ns)
          throws org.jdom.JDOMException,
                 InvalidKeyException,
                 NoSuchAlgorithmException,
                 SignatureException,
                 org.apache.xml.security.exceptions.XMLSecurityException,
                 SQLException,
                 ParserConfigurationException,
                 IOException,
                 SAXException,
                 SemillaException
Método encargado de firmar la semilla

Parameters:
pKey -
cert -
ns -
Throws:
org.jdom.JDOMException
InvalidKeyException
NoSuchAlgorithmException
SignatureException
org.apache.xml.security.exceptions.XMLSecurityException
SQLException
ParserConfigurationException
IOException
SAXException
SemillaException

getNiceXML

public static void getNiceXML(org.jdom.Document doc,
                              OutputStream out)
                       throws SemillaException
Escribe el valor de la semilla en un OutputStream

Parameters:
doc -
out -
SemillaException