gpt4 book ai didi

com.sun.xml.wss.XWSSecurityException.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 03:38:40 26 4
gpt4 key购买 nike

本文整理了Java中com.sun.xml.wss.XWSSecurityException.<init>()方法的一些代码示例,展示了XWSSecurityException.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWSSecurityException.<init>()方法的具体详情如下:
包路径:com.sun.xml.wss.XWSSecurityException
类名称:XWSSecurityException
方法名:<init>

XWSSecurityException.<init>介绍

[英]Constructor specifying the message string.
[中]指定消息字符串的构造函数。

代码示例

代码示例来源:origin: com.hynnet/xws-security

public Object getBody() throws XWSSecurityException {
  if (body != null) {
    return body;
  } else if (securedBody != null) {
    return securedBody;
  } else {
    throw new XWSSecurityException("No body present in message");
  }
}

代码示例来源:origin: com.hynnet/xws-security

public static byte[] getThumbprintIdentifier(X509Certificate cert)
  throws XWSSecurityException {
  byte[] thumbPrintIdentifier = null;
                                                         
  try {
    thumbPrintIdentifier = MessageDigest.getInstance("SHA-1").digest(cert.getEncoded());
  } catch ( NoSuchAlgorithmException ex ) {
    throw new XWSSecurityException("Digest algorithm SHA-1 not found");
  } catch ( CertificateEncodingException ex) {
    throw new XWSSecurityException("Error while getting certificate's raw content");
  }
  return thumbPrintIdentifier;
}

代码示例来源:origin: com.hynnet/xws-security

public static void registerCanonicalizer(String baseMimeType,
                     String implementingClass) throws XWSSecurityException {
   try {
     Class _class = Class.forName(implementingClass);
     Canonicalizer canonicalizer = (Canonicalizer)_class.newInstance();            
     _canonicalizers.put(baseMimeType, canonicalizer);
   } catch (Exception e) {
     // log
     throw new XWSSecurityException(e);
   } 
}

代码示例来源:origin: com.hynnet/xws-security

static void throwWssSoapFault(String message) throws WssSoapFaultException {
  XWSSecurityException xwsse = new XWSSecurityException(message);
  log.log(Level.SEVERE, "WSS0809.fault.WSSSOAP", xwsse);
  throw SecurableSoapMessage.newSOAPFaultException(
      MessageConstants.WSSE_INVALID_SECURITY,
      message,
      xwsse);
}

代码示例来源:origin: com.hynnet/xws-security

/**
 * Method getSerialNumber
 *
 * @throws XWSSecurityException
 */
public BigInteger getSerialNumber() throws XWSSecurityException {
  try {
    return delegate.getSerialNumber();
  } catch (Exception e) {
    throw new XWSSecurityException(e);
  }
}

代码示例来源:origin: com.hynnet/xws-security

public KerberosContext doKerberosLogin() throws XWSSecurityException {
  if(krbLoginModule == null || krbLoginModule.equals("")){
    throw new XWSSecurityException("Login Module for Kerberos login is not set or could not be obtained"); 
  }
  if(krbServicePrincipal == null || krbServicePrincipal.equals("")){
    throw new XWSSecurityException("Kerberos Service Principal is not set or could not be obtained");
  }
  return new KerberosLogin().login(krbLoginModule, krbServicePrincipal, krbCredentialDelegation);
}

代码示例来源:origin: com.hynnet/xws-security

public PublicKey getPublicKey(Map context, byte[] keyIdentifier)
  throws XWSSecurityException {
  try {
    return getMatchingCertificate(context, keyIdentifier).getPublicKey();
  } catch (Exception e) {
    throw new XWSSecurityException(e);
  }
}

代码示例来源:origin: com.hynnet/xws-security

public void addX509Data(X509Data x509Data) throws XWSSecurityException {
    try {
      delegateKeyInfo.add(x509Data);
      dirty = true;
    } catch (Exception e) {
      log.log(Level.SEVERE, "WSS0359.error.adding.x509data", e.getMessage());
      throw new XWSSecurityException(e);
    }
  }
}

代码示例来源:origin: com.hynnet/xws-security

private void checkBSP5607(String elemName, String uri, boolean contentOnly) throws XWSSecurityException {
    // BSP: 5607
    if (!contentOnly && (MessageConstants.SOAP_1_1_NS.equalsIgnoreCase(uri) || MessageConstants.SOAP_1_2_NS.equalsIgnoreCase(uri))
        && ("Header".equalsIgnoreCase(elemName) || "Envelope".equalsIgnoreCase(elemName) || "Body".equalsIgnoreCase(elemName))) {
      logger.log(Level.SEVERE,LogStringsMessages.WSS_1918_ILLEGAL_ENCRYPTION_TARGET(uri, elemName));
      throw new XWSSecurityException("Encryption of SOAP " + elemName + " is not allowed"); // BSP 5607
    }
  }
}

代码示例来源:origin: com.hynnet/xws-security

/**
 * 
 * @throws com.sun.xml.wss.XWSSecurityException 
 */
public final static void log_bsp_3227() throws XWSSecurityException{
  log.log(Level.SEVERE,LogStringsMessages.BSP_3227_SINGLE_TIMESTAMP());
  throw new XWSSecurityException(LogStringsMessages.BSP_3227_SINGLE_TIMESTAMP());
}

代码示例来源:origin: com.hynnet/xws-security

public SOAPEnvelope getEnvelope() throws XWSSecurityException {
  SOAPEnvelope envelope = null;
  
  try {
    envelope = getSOAPPart().getEnvelope();
  } catch (Exception e) {
    log.log(Level.SEVERE, "WSS0399.soap.envelope.exception", e);
    throw new XWSSecurityException(e);
  }
  
  return envelope;
}

代码示例来源:origin: com.hynnet/xws-security

public PublicKey getPublicKey(String keyIdentifier)
  throws XWSSecurityException {
  try {
    return getMatchingCertificate(null,
      getDecodedBase64EncodedData(keyIdentifier))
      .getPublicKey();
  } catch (Exception e) {
    throw new XWSSecurityException(e);
  }
}

代码示例来源:origin: com.hynnet/xws-security

public void writeTo(OutputStream os) throws XWSSecurityException {        
  Marshaller mh;        
  try {            
    mh = jc.createMarshaller();            
    mh.setProperty("com.sun.xml.bind.c14n",true);            
    mh.marshal(jb,os);            
  } catch (javax.xml.bind.JAXBException ex) {            
    logger.log(Level.SEVERE, LogStringsMessages.WSS_1610_ERROR_MARSHALLING_JBOBJECT(jb.getName()));            
    throw new XWSSecurityException(LogStringsMessages.WSS_1610_ERROR_MARSHALLING_JBOBJECT(jb.getName()),ex);            
  }        
}

代码示例来源:origin: org.glassfish.metro/wssx-api

public Key getDecipheredOtherPartyEntropy(Key privKey) throws XWSSecurityException {
  try {
    return getDecipheredOtherPartyEntropy(getOtherPartyEntropy(), privKey);
  } catch ( XMLEncryptionException xee) {
    throw new XWSSecurityException(xee);
  }
}

代码示例来源:origin: com.hynnet/xws-security

public Key getDecipheredOtherPartyEntropy(Key privKey) throws XWSSecurityException {
  try {
    return getDecipheredOtherPartyEntropy(getOtherPartyEntropy(), privKey);
  } catch ( XMLEncryptionException xee) {
    throw new XWSSecurityException(xee);
  }
}

代码示例来源:origin: com.hynnet/xws-security

public void setReferenceValue(String encodedValue)
  throws XWSSecurityException {
  removeContents();
  try {
    addTextNode(encodedValue);
  } catch (SOAPException e) {
    log.log(Level.SEVERE,
        "WSS0757.error.setting.reference",
        e.getMessage());  
    throw new XWSSecurityException(e);
  }
}

代码示例来源:origin: com.hynnet/xws-security

/**
 * Method appendObject.
 */
public void appendObject(SOAPElement object) throws XWSSecurityException {
  try {
    ObjectContainer objc = new ObjectContainer(object, null);
    delegateSignature.appendObject(objc);
  } catch (XMLSecurityException e) {
    log.log(Level.SEVERE, "WSS0382.error.appending.object", e.getMessage());
    throw new XWSSecurityException(e);
  }
}

代码示例来源:origin: com.hynnet/xws-security

public void validate(ProcessingContext context) throws XWSSecurityException {
  try{
    context.getSecurityEnvironment().validateSAMLAssertion(context.getExtraneousProperties(),readHeader());
    context.getSecurityEnvironment().updateOtherPartySubject((Subject)context.getExtraneousProperties().get(MessageConstants.AUTH_SUBJECT),readHeader());
  }catch(XMLStreamException xe){
    throw new XWSSecurityException("Error occurred while trying to validate SAMLAssertion",xe);
  }
}

代码示例来源:origin: com.hynnet/xws-security

protected KeyIdentifier buildKeyInfoWithKIKerberos(AuthenticationTokenPolicy.KerberosTokenBinding binding, String refType) throws XWSSecurityException{
  KeyIdentifier keyIdentifier = elementFactory.createKeyIdentifier();
  keyIdentifier.setValueType(refType);
  keyIdentifier.updateReferenceValue(binding.getTokenValue());
  keyIdentifier.setEncodingType(MessageConstants.BASE64_ENCODING_NS);
  if(keyIdentifier.getValue() == null || keyIdentifier.getValue().length() ==0){
    logger.log(Level.SEVERE,LogStringsMessages.WSS_1852_KEY_IDENTIFIER_EMPTY());
    throw new XWSSecurityException(LogStringsMessages.WSS_1852_KEY_IDENTIFIER_EMPTY());
  }
  buildKeyInfo(keyIdentifier,binding.getSTRID());
  return keyIdentifier;
}

代码示例来源:origin: com.hynnet/xws-security

protected Data toData(Object header,boolean contentOnly, JAXBFilterProcessingContext context)throws XWSSecurityException{
    if(header instanceof SecurityElement){
      return new SSEData((SecurityElement)header,contentOnly, context.getNamespaceContext(), props);
    }if(header instanceof JAXBHeader){
      return new  JAXBDataImpl((com.sun.xml.ws.api.message.Header) header, contentOnly, context.getNamespaceContext());
    }else if(header instanceof com.sun.xml.ws.api.message.Header){
      return new StreamHeaderData((com.sun.xml.ws.api.message.Header)header,contentOnly, context.getNamespaceContext());
    }else{
      throw new XWSSecurityException("Unsupported Header type");
    }
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com