A
download X509CertToken.java
Language: Java
Copyright: (c) 2005 by Sun Microsystems/Ray Lai under Common Development and Distribution License
LOC: 27
Project Info
identity management security patterns(identitypatterns)
Server: java.net
Type: cvs
...terns\src\com\csp\identity\
   Assertion.java
   AssertionBuilder.java
   AssertionContext.java
   AssertionContextImpl.java
   Attribute.java
   AttributeStatement.java
   ...nticationStatement.java
   ...nDecisionStatement.java
   BinaryToken.java
   CredentialTokenizer.java
   SecurityToken.java
   SSOContext.java
   SSOContextImpl.java
   SSODelegator.java
   SSODelegatorException.java
   SSODelegatorFactory.java
   ...legatorFactoryImpl.java
   ...er_SampleFunction1.java
   SSOServiceProvider.java
   ...rviceProviderImpl1.java
   ...rviceProviderImpl2.java
   Subject.java
   TokenContext.java
   TokenContextImpl.java
   UsernameToken.java
   X509CertToken.java

/*
 * Program:    X509CertToken.java
 * Purpose:    Class object for encapsulating X.509v3 certificate as security token
 * @author     Ray Lai (ray.lai@sun.com)
 * @version    1.1
 * Updated:    April 16, 2005
 * Copyright:  (c) 2005 by Sun Microsystems/Ray Lai under Common Development and Distribution License
 * Remarks:    Full program and documentation will be available under developer.java.net
 *             For simplicity, logger class is removed.
 * =====================================================================================
 */

package com.csp.identity;

import java.math.BigInteger;

public class X509CertToken extends com.csp.identity.SecurityToken {
    
    protected java.security.cert.X509Certificate  x509cert;
    static final String                           TOKEN_TYPE = "X509CERT_TOKEN";

    /** Constructor - create X509CertToken 
     *
     *  In future implementation, the constructor should be private, and this class
     *  should provide a getInstance() to fetch the instance.
     */
    public X509CertToken(String principal, 
            java.security.cert.X509Certificate x509cert,
            String crypto) {
        
        // Crypto is a temp class; Set to null when creating the constructor.
        // In future, this can be Apache Merlin's Crypto type
        this.principal = principal;
        this.x509cert = x509cert;
    }
    /**
     * Get token id from the binary token
     *
     * @return binaryToken security token in binary form
     */
    public java.security.cert.X509Certificate getToken() {
        return this.x509cert;
    }
    
    public String getIssueDN() {
        return this.x509cert.getIssuerDN().toString();
    }

    public String getSubjectDN() {
        return this.x509cert.getSubjectDN().toString();
    }

    public BigInteger getSerialNumber() {
        return this.x509cert.getSerialNumber();
    }
    
    public int getVersion() {
        return this.x509cert.getVersion();
    }
}

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us